Quote:
Originally Posted by pavansap
hi i want diff between two dates in (days,hours,and mins format)
but the date field in my data base is 2011-9-11 23:15:00
Can some please help me to find out the problem....
|
You didn't say what the problem is.
There is nothing wrong with the format 2011-9-11 23:15:00.
To find out the difference between 2 dates, use the DateDiff function.
DateDiff
DateDiff returns a number of time intervals between two specified dates
Syntax:
DateDiff (intervalType, startDateTime, endDateTime)
DateDiff (intervalType, startDateTime, endDateTime, firstDayOfWeek)
• intervalType is a String expression that is the interval of time you use to calculate the difference between startDateTime and endDateTime.
• startDateTime is the first DateTime value used in calculating the difference.
• endDateTime is the second DateTime value used in calculating the difference.
• firstDayOfWeek is an optional constant specifying the first day of the week.
Returns
A Number value