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.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Date is less than 2008

Author  Topic 

baska123
Yak Posting Veteran

64 Posts

Posted - 2008-05-22 : 11:09:36
I have a Actual_dt column that is a type of date. I am trying to get all the values from the table that have the date less than 2008/01/01.

Please help.
Thanks

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-05-22 : 11:11:50
SELECT * FROM YourTable WHERE Actual_dt < '01/01/2008'
Go to Top of Page

baska123
Yak Posting Veteran

64 Posts

Posted - 2008-05-22 : 11:17:40
It would be to easy. Error, literal does not match format string. do I need to use some kind of a date function in front of the string?
Go to Top of Page

Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)

7020 Posts

Posted - 2008-05-22 : 11:23:24
Is the database you are using Microsoft SQL Server?

Is the datatype of the Actual_dt column datetime?



CODO ERGO SUM
Go to Top of Page

baska123
Yak Posting Veteran

64 Posts

Posted - 2008-05-22 : 11:24:30
I am using oracle and the datatype is date.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-05-22 : 11:29:54
quote:
Originally posted by baska123

I am using oracle and the datatype is date.


Then you're in wrong forum. This is MS SQL Server forum. Try posting it on some oracle forums to get solution.
Go to Top of Page

baska123
Yak Posting Veteran

64 Posts

Posted - 2008-05-22 : 11:32:33
Thank you for your help, that much I knew...
Go to Top of Page
   

- Advertisement -