Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
cnbhold
Starting Member
43 Posts |
Posted - 2011-05-25 : 00:33:43
|
| I need to create a query that will calculate the number of days between two dates.Table Name: DatesTable StructureDate1 (date)Date2 (date)NumberOfDays (int)Sample DataDate1 ..........Date2 .........NumberofDays2011-5-5........2011-5-10..........52011-5-15......2011-5-21..........6 |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2011-05-25 : 02:00:48
|
select datediff(day,Date1,Date2) No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
cnbhold
Starting Member
43 Posts |
Posted - 2011-05-25 : 05:57:54
|
| That worked. Thanks! |
 |
|
|
|
|
|