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 |
|
AF
Starting Member
7 Posts |
Posted - 2009-08-14 : 08:08:49
|
| Hello.I have a log of people calling an adviceline and I want to run a query that returns everyone who has called since a set date.I've got a date colunm in a datetime format but can't figure out how to set a 'great than' parameter on it. Any advice?ThanksAlex. |
|
|
Transact Charlie
Master Smack Fu Yak Hacker
3451 Posts |
Posted - 2009-08-14 : 08:15:13
|
| [code]DECLARE @foo TABLE ( [ID] INT IDENTITY(1,1) , [datestamp] DATETIME )INSERT @foo SELECT '20090101'UNION SELECT '20090201'UNION SELECT '2009-03-01T23:34:02'-- Every record where datestamp after 18th Jan 2009SELECT * FROM @fooWHERE [dateStamp] > '20090118'[/code]Charlie===============================================================Msg 3903, Level 16, State 1, Line 1736The ROLLBACK TRANSACTION request has no corresponding BEGIN TRANSACTION |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-08-15 : 03:12:22
|
| you can create a procedure with query shown and having a parameter of datetime to pass the required date value. |
 |
|
|
AF
Starting Member
7 Posts |
Posted - 2009-08-20 : 12:18:12
|
| Thanks very much - that did the trick! |
 |
|
|
|
|
|