Date Diff Expression

abordeau

Registered User.
Local time
Yesterday, 23:27
Joined
Aug 8, 2013
Messages
10
Hello All,

I am having a problem with a datediff expression.

I have a query that pulls the first date and the last date out of a list but are put in seperate fields. I thought I could build an expression for datediff to calculate the number of dates between them. I can't just put in the dates because they are constently changing.

The expression I have is:

[datediff("d",[min/max edging unit #2]![firstofupdate/time by month],[min/max edging unit #2]![lastofupdate/time by month])]


but it's not working. can anyone see anything wrong?

Thanks,

Angelina
 
you don't need the square brackets on the outside of the datediff function.

If this is not it, you will need to explain what 'not working' means
 
by not working I mean it returns nothing in the query. There are 22 records in the query and what I want is to calculate the number of days between the first and last dates.
 
If you have a query that kindoff goes
Select Min(YourDatefield), max(yourdatefield)

And you want to know the difference between the two... you have to repeat your min and max statements
datediff("d",Min([min/max edging unit #2]![firstofupdate/time by month]),Max([min/max edging unit #2]![lastofupdate/time by month]))
 
Thanks guys,

It was much more involved. I ended up having to build lots of other queries to get my end result.
 

Users who are viewing this thread

Back
Top Bottom