Quote:
Originally posted by zw^
I have 2 date field
Startdate:
EndDate:
How to use EndDate - StartDate????
Datediff function allow you to chose 1 date variable only
mine have to enter 2 date
how?????
|
DateDiff takes at least 3 parameters:
DateDiff(<datepart>, <date1>, <date2>)
Datepart is a character representing the part of the date to return the value a (YYYY = Year, Q = Quarter, M = Month, D = Day, W = Weekday, WW = Week, H = Hour, N = Minute, S = Second)
Date1 is the first date in the comparison.
Date2 is the second date in the comparison.
Code:
Response.Write DateDiff("YYYY", Now, "1/1/2000")
That should return "3" (if it's negative, just switch the dates)