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
 Development Tools
 ASP.NET
 to_date (Oracle) --> SQL Server

Author  Topic 

delphi007
Starting Member

2 Posts

Posted - 2004-05-17 : 06:21:38
Hi I have trouble getting the following Oracle Code to run by SQL Server. The to_date function is not known bei SQL Server.
I tried to write it with cast and convert but still won't get it running.
I would appreciate any help...


[...]

' getting DateAfter...
strDateAfter = request("DayAfter") & "-" & request("MonthAfter") & "-" & request("YearAfter")
strDateBefore = request("DayBefore") & "-" & request("MonthBefore") & "-" & request("YearBefore")

if len(strDateAfter) = 8 and len(strDateBefore) = 8 then

whrDate = " to_date(lease_end_date, 'dd-mm-yy') BETWEEN to_date('" & strDateAfter & "', 'dd-mm-yy') AND to_date('" & strDateBefore & "', 'dd-mm-yy') AND"

[...]

nr
SQLTeam MVY

12543 Posts

Posted - 2004-05-17 : 07:24:52
convert(datetime, dte, 5)

Look at the styles on the convert.
Better to pass in as yyyymmdd then theres no problem.

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page
   

- Advertisement -