Datediff Function

DBFIN

Registered User.
Local time
Today, 10:21
Joined
May 10, 2007
Messages
205
I'm tyring to calculate the difference in days between 20140131 and the POLEFFDATE field which is a number in YYYYMMDD format. I've used the following syntax, but get an incorrect result, 223924. What is the problem with this syntax ?

DateDiff("d",DateSerial(Left([POLEFFDATE],4),Mid([POLEFFDATE],5,2),Right([POLEFFDATE],2)),DateSerial(2014,1,31))
 
I corrected the syntax. This works:

DateDiff("d",DateSerial(Left([TERMDATE],4),Mid([TERMDATE],5,2),Right([TERMDATE],2)),DateValue(#1/31/2014#))

:)
 

Users who are viewing this thread

Back
Top Bottom