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)
 TO_DATE is not a recognized built-in function name

Author  Topic 

somenoob
Posting Yak Master

112 Posts

Posted - 2011-09-25 : 22:04:28
Hi everyone, i have this code:

Select Distinct ATB from DB
Where ( ATB >= TO_DATE('2007-05-01', 'yyyy-MM-dd') AND ATB < TO_DATE('2007-06-01', 'yyyy-MM-dd') )

but it says that

TO_DATE is not a recognized built-in function name. (Microsoft SQL Server, Error:195)

Please Help

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-09-26 : 00:47:07
if its sql server and ATB is of datetime type, then below should suffice
Select Distinct ATB from DB
Where ( ATB >= '20070501' AND ATB < '20070601')


------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

somenoob
Posting Yak Master

112 Posts

Posted - 2011-09-26 : 01:34:27
please help, when i run this code,

SELECT * FROM OPENQUERY(ServerLinkEODWMain, 'SELECT ATB FROM DB WHERE ATB >= ''20070501'' AND ATB < ''20070601''')

the error appeared
OLE DB provider "MSDAORA" for linked server "ServerLinkEODWMain" returned message "ORA-01861: literal does not match format string
Go to Top of Page
   

- Advertisement -