[AccessD] OT: SQL SERVER DATEDIFF - DECIMAL PRECISION

Gustav Brock gustav at cactus.dk
Wed May 26 04:26:40 CDT 2004


Hi Paul

In that case you are not looking for a difference in days between
dates but in hours (or minutes or seconds as to the precision you
need) between dates and times.

Adjust your code to calculate, say, hours; then divide by 24 to obtain
the result in decimal days.

/gustav

> I'm looking to calculate the number of days between two days.  I got
> it to run perfectly however I want to show one decimal precision.
> The query results shows 1.0 when in fact it is really 1.33.  

> StartDate and ClosedDate are data types.

> select
> Avg(DATEDIFF(day, StartDate, ClosedDate)) AS TurnDays
> from
> tblPrCas




More information about the AccessD mailing list