Datediff problems in Report

pbassett

Active Member
Joined
May 5, 2004
Messages
358
My Activities report lists several date fields: Start Date, Write-up Date, and End Date. I need to display the Aging of each Activity. This is simply the number of days since the Start Date. I entered the Control Source as
=DateDiff("d",[Start Date],Date())

For some reason this is not working, and the result is as if I entered
=DateDiff("d",[End Date],Date())
as the Control Source.

Apparently it's reading the Start Date wrong! Strangely, the calculation works correctly if I use Write-up Date.

Additionally, [Start Date] alone displays OK, but "=[Start Date]" displays End Date, so I think the equals sign is causing a problem! I tried
DateDiff("d",[End Date],Date())
but got a syntax error (no "=")

Any reason why the equals sign could cause a display error?
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
Hi

It sounds like there is an issue with the naming of some of the fields within the report or in the underlying data source. While you are in the report design screen, select the start and end date objects on the form and check the 'Name' property of these objects - it sounds like one object might have the name of the other. This is entirely possible and results in the incorrect information being pulled into a calculated field on the report.

If this doesn't resolve the issue, is the report based on a table or a query? If the report is based on a query can you post your SQL? If the control source of the report is a query have you considered calculating the aging within the query instead to avoid issues with the naming of controls?

HTH, Andrew
 
Upvote 0

Forum statistics

Threads
1,203,240
Messages
6,054,316
Members
444,717
Latest member
melindanegron

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top