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 |
luzner
Starting Member
2 Posts |
Posted - 2007-07-31 : 08:40:47
|
I have the following sql query :osql -U sa -P test -d TESTDSN -Q "SELECT COUNT(*) FROM SEOSDATA where LOGNAME = 'CPlog'" How can I change the query to get the only events from the last 24 hours and not count of all events ?Thanks! |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2007-07-31 : 08:46:37
|
Tryosql -U sa -P test -d TESTDSN -Q "SELECT COUNT(*) FROM SEOSDATA where LOGNAME = 'CPlog' and datecol>=Dateadd(hour,-24,getdate())" MadhivananFailing to plan is Planning to fail |
 |
|
luzner
Starting Member
2 Posts |
Posted - 2007-07-31 : 09:05:59
|
Thanks it's working great! |
 |
|
|
|
|