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 |
|
dasu
Posting Yak Master
104 Posts |
Posted - 2004-10-16 : 02:06:29
|
| THIS WILL GIVE NO OF DAYS DIFFERENCEBUT I WANT DATE DIFFERENCEQUERRY I MENTIONED BELLOW USE pubsGOSELECT DATEDIFF(DAYS , pubdate, getdate()) AS no_of_daysFROM titlesGO |
|
|
Seventhnight
Master Smack Fu Yak Hacker
2878 Posts |
Posted - 2004-10-16 : 02:54:23
|
what do you mean by 'Date Difference'? What measurement do you want to use to quantify the difference?Looks like you are on the right track, just lookup the other options for datediff paramsEDIT: That's 1000!Corey |
 |
|
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2004-10-16 : 09:07:51
|
| maybeselect getdate() - pubdtae from titlesthat will give the difference as a datetime.==========================================Cursors are useful if you don't know sql.DTS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
|
dasu
Posting Yak Master
104 Posts |
Posted - 2004-10-19 : 07:04:10
|
| thanks i got the solution i want to share this to u all SET @intMxValDays=90--finding the date before specific period SET @dtValDt=DATEADD(day, -@intMxValDays,@dtLogicalDt) |
 |
|
|
|
|
|