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 |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2002-04-05 : 08:08:40
|
| Andy Lau writes "I always had a problem getting the date that matches with a date in the database. I have a database table with a column that contains the date/time. How can i write an SQL Statement to match all those records that has a date which is 1 day before today's date? Anyone can help me? Thanks :)" |
|
|
AndrewMurphy
Master Smack Fu Yak Hacker
2916 Posts |
|
|
jackstow
Posting Yak Master
160 Posts |
Posted - 2002-04-05 : 08:39:03
|
| Look up DATEDIFF on Books Online - or more specifically;SELECT * FROM MyTable WHERE DATEDIFF(day, MyDateColumn, getdate() ) = 1********Oh - I didn't notice the double posting..Edited by - jackstow on 04/05/2002 08:40:38 |
 |
|
|
|
|
|