View Full Version : Simple Expression has me stumped


m17347047711116
01-11-2009, 10:33 AM
Query has 3 fields

[Due Date], [Run Date], [Fin Date]

Exp:[Due Date]-(Max[Run Date],[Fin Date])
The above is the expression that is not working in my query, below is some sample date that demonstrates what I am looking for

[Due Date].......[Run Date].......[Fin Date]
[Jan 20 09].......[Jan 13 09]......[Jan 18 09]

Returned value from the expression on the above sample would be "2"
any ideas?

pbaldy
01-11-2009, 10:36 AM
You can't find the max that way. Try this:

http://support.microsoft.com/default.aspx?scid=kb;en-us;209857

raskew
01-11-2009, 03:08 PM
Hi -

Give this a try as a calculated field in your query.

Exp: DateDiff("d",Iif([run date]>[fin date],[run date],[fin date]),[due date])


HTH - Bob