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 |
jpiscit1
Posting Yak Master
130 Posts |
Posted - 2004-04-01 : 13:11:56
|
I know this should not be hard, but I cant seem to get the right syntax to get it to work.I have a query with a date column. Upon open I want it to show only records for today. How would I set up the DateDiff function in the criteria field? Also, If i wanted to show the past weeks (-7days) worth of records, how would I do that?Thanks. |
|
X002548
Not Just a Number
15586 Posts |
Posted - 2004-04-01 : 13:16:56
|
WHEARE DATEDIFF(d,dteCol,Date()) BETWEEN 0 AND 7Or is 0 and -7Put it in the select to see the values and test it...Brett8-) |
 |
|
X002548
Not Just a Number
15586 Posts |
Posted - 2004-04-01 : 13:20:51
|
That syntax is 0 and 7Brett8-) |
 |
|
jpiscit1
Posting Yak Master
130 Posts |
Posted - 2004-04-01 : 13:39:00
|
Yep...Thanks!!! That did it |
 |
|
|
|
|