Forum: ASP Classic |
Thema:
to_date ( ORACLE) SQL Server |
Von:
Sebastian Fetter (
17.05.2004 12:45) |
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"
[...]
Betreff |
Von |
Datum |
|
  |
Re: to_date ( ORACLE) SQL Server
Hi, <br><br>the cast (or better the convert) in MSSQL should look like this:<br>...<br>(Convert(Char(8), LTRIM(STR(VALID_FROM_YEAR)) + " &_<br>" RIGHT('0' + LTRIM(STR(VALID_FROM_MONTH)),2) + " &_<br>" RIGHT('0' +... |
 |
 |
 |
|
|
Rainer
Jeschor
|
17.05.2004 13:13 |
|
|
Antworten
Vorsicht bei der Eingabe: Die Zeichen ' oder -- sind nicht erlaubt!