Re: MS SQL statement translated into Informix
Posted in 1999
Topics: Cloud, Docker & Containers
From: "RDawson" <rwdawson@hotmail.com>
>
>I'm looking for a little help converting a MS SQL statement into Informix
>syntax. This is what the MS SQL statement looks like:
>
>Declare @YesterdaysDate INT
>Set @YesterdaysDate = (Cast( LTrim( Str( DatePart( yy, GetDate()) - 1900))
>+ LTrim( Str( DatePart( mm, GetDate())))
>+ LTrim( Str( DatePart( dd, GetDate()))) as Int))-1
>select table1.day1
>from table1
>where table1.day1=@YesterdaysDate
>order by table1.day1>
>The query works great in Informix without the Declare / Set statement and
>using a real integer in the 'where' statement, i.e. where
>table1.day1=991215
select table1.day1
from table1
where table1.day1= year(today - 1) - 1900 || month(today - 1) || day(today -
1)
order by table1.day1
I even tested it. :-)
______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com
I'll give it a shot. How do I convert it to an integer?
Obnoxio The Clown wrote in message <83dr53$j80$1@news.xmission.com>...
>
>From: "RDawson" <rwdawson@hotmail.com>
>>
>>I'm looking for a little help converting a MS SQL statement into Informix
>>syntax. This is what the MS SQL statement looks like:
>>
>>Declare @YesterdaysDate INT
>>Set @YesterdaysDate = (Cast( LTrim( Str( DatePart( yy, GetDate()) - 1900))
>>+ LTrim( Str( DatePart( mm, GetDate())))
>>+ LTrim( Str( DatePart( dd, GetDate()))) as Int))-1
>>select table1.day1
>>from table1
>>where table1.day1=@YesterdaysDate
>>order by table1.day1>>
>>The query works great in Informix without the Declare / Set statement and
>>using a real integer in the 'where' statement, i.e. where
>>table1.day1=991215
>
>select table1.day1
>from table1
>where table1.day1= year(today - 1) - 1900 || month(today - 1) ||day(today -
>1)
>order by table1.day1
>
>I even tested it. :-)
>
>______________________________________________________
>Get Your Private, Free Email at http://www.hotmail.com
>