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
 General SQL Server Forums
 New to SQL Server Programming
 To Date funtion

Author  Topic 

gerardgel
Starting Member

3 Posts

Posted - 2008-09-11 : 13:18:27
I am trying to create a query that selects first_name for a table where the bith_date is in januray but shown as 01
i thought about using like% but that doesnt seem to work
can any one help
SELECT
first_name,
birth_date

FROM

targets

WHERE

birth_date>TO_DATE LIKE('%-01-%','DD-MM-YYYY')

jhocutt
Constraint Violating Yak Guru

385 Posts

Posted - 2008-09-11 : 13:34:06
TO_DATE is an Oracle function, is this for an Oracle database please look in an Oracle user group.
That being said

where to_char(birth_date, 'mm') = '01'

"God does not play dice" -- Albert Einstein
"Not only does God play dice, but he sometimes throws them where they cannot be seen."
-- Stephen Hawking
Go to Top of Page

gerardgel
Starting Member

3 Posts

Posted - 2008-09-11 : 14:04:13
thanks for that, big help
Go to Top of Page
   

- Advertisement -