>>>>Hi,
>>>>
>>>>How do you SUM number of days difference between two DateTime type fields as following:
>>>>
>>>>
>>>>select SUM( DATETIME1 - DATETIME2) AS NUMDAYS
>>>>
>>>
>>>SELECT SUM(DATEDIFF(dd, Date1, Date2)) AS NumDays
>>>
>>
>>Borislav,
>>
>>I am trying to understand the DATEDIFF() function better. Do I understand correctly that the 1st parameter "dd" really has no literal meaning? That is, you can name this parameter anything and it won't change the result?
>
>It has, it means days :-)
>As Naomi said it means we wand to get difference in days. Check BOL to see the other values of the first parameter.
Yes, this is what I did (after posting the question instead of before :)); I read about DATEDIFF() in BOL and it all is clear now.
Thank you.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham