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 |
|
abunney
Starting Member
2 Posts |
Posted - 2005-06-22 : 12:32:21
|
| Hi hope someone can help as my skills with T-SQL are rudimentary as they are very peripheral to my job.I have a database with a table called forumMessages to store some forum postings, these are timestamped when inserted into the database.I want to extract all fields for all off the postingsby a particular user in the last 360(for example) days, I've got this far:SELECT *FROM dbo.forumMessagesWHERE authorID = 150 AND timestamp BETWEEN CURRENT_TIMESTAMP AND DATEADD(day, -360, CURRENT_TIMESTAMP);This runs OK but returns no records (this should produce lots records if it was doing what my addled brain thought it was doing).Now I am stumped, any ideas?CheersAndrew |
|
|
TG
Master Smack Fu Yak Hacker
6065 Posts |
Posted - 2005-06-22 : 12:53:13
|
| reverse the dates so that:between <earlierDate> and <laterDate>Be One with the OptimizerTG |
 |
|
|
abunney
Starting Member
2 Posts |
Posted - 2005-06-22 : 13:25:19
|
Many thanks! |
 |
|
|
|
|
|