AS others have indicated, the "datepart" is the desginator for the part of the date on which to calculate the date difference. SQL Books Online Help will give you all these answers. Just type in "DATEDIFF". The dateparts listed are:
datepart Abbreviations
year yy, yyyy
quarter qq, q
month mm, m
dayofyear dy, y
day dd, d
week wk, ww
hour hh
minute mi, n
second ss, s
millisecond ms
microsecond mcs
nanosecond ns
Bill
>>Hi Kevin,
>>
>>One method would be to use the T-SQL DATEDIFF ( datepart , startdate , enddate ) function.
>>
>>Bill
>>
>>>How do I calculate the number of days between two dates in SQL?
>>>
>>>
>>>SELECT APM_InvoiceDate - APM_DiscDate AS [VR-DSC-DAYS]
>>> FROM iERP72_Test.dbo.APM
>>>
>>>
>>>This returns a datetime
>
>Specifying what for datepart?
William A. Caton III
Software Engineer
MAXIMUS
Atlanta, Ga.