|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
counting days between dates
I got another request from marketing....
I need to count the days between the FirstOrderDate (column 1, datetime datatype) and the LastOrderDate (column2, datetime datatype), which will give me the LifeTime (column3), which is the total number of days the customer has been ordering from us. What's the quickest way to do this in SQL? thanks in advance for any help. |
|
#2
|
|||
|
|||
|
figured it out....
SELECT DATEDIFF(day, firstorderdate, lastorderdate) AS no_of_days
FROM [table] GO |
![]() |
| Viewing: ASP Free Forums > Database > SQL Development > counting days between dates |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|