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 |
|
kwazzle
Starting Member
2 Posts |
Posted - 2009-11-12 : 13:55:47
|
| Hi I'm pretty new to SQL and I'm having some serious difficulty on writing a script that will have this report run from yesterday to today at a certain time 10AM, showing results within that 24 hour period.Please help! Thanks! |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
rdeavers
Starting Member
2 Posts |
Posted - 2009-11-12 : 14:05:53
|
| You're probably running esp usb 1.0. If you upgrade to 2.0, that should fix the problem. |
 |
|
|
kwazzle
Starting Member
2 Posts |
Posted - 2009-11-12 : 14:05:55
|
| SELECT *FROM my.tableWHERE declare @yesterday datetime;declare @today datetime; set @yesterday = current_timestamp;datefield >= DATEADD(mm,DATEDIFF(mm,0,CURRENT_TIMESTAMP-1),0)and datefield < DATEADD(mm,DATEDIFF(mm,0,CURRENT_TIMESTAMP-1)+1,0)ORDER BY *goI was thinking about using the DATEADD or GETDATE but both times I try, I get the random day I set for it. Results are supposed to be this report and it has a date/time column if that helps. |
 |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
|
|
|
|
|