Re : Instruction MS SQL traduite en Informix
Posted in 1999
Topics: Cloud, Docker & Containers
Translated from English by DrWatson — View original
De : "RDawson" <rwdawson@hotmail.com> > >Je cherche un peu d'aide pour convertir une instruction MS SQL en syntaxe >Informix. Voici à quoi ressemble l'instruction MS SQL : > >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 > >La requête fonctionne très bien sous Informix sans les instructions Declare / Set et >en utilisant un véritable entier dans la clause « where », c'est-à-dire 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 Je l'ai même testée. :-) ______________________________________________________ Obtenez votre messagerie personnelle gratuite sur http://www.hotmail.com
Je vais essayer. Comment faire pour le convertir en entier ? Obnoxio The Clown a écrit dans le message <83dr53$j80$1@news.xmission.com>... > >De : "RDawson" <rwdawson@hotmail.com> >> >>Je cherche un peu d'aide pour convertir une instruction MS SQL en syntaxe >>Informix. Voici à quoi ressemble l'instruction MS SQL : >> >>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 >> >>La requête fonctionne parfaitement sous Informix sans l'instruction Declare / Set et >>en utilisant un véritable entier dans la clause « where », par exemple 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 > >Je l'ai même testé. :-) > >______________________________________________________ >Obtenez votre messagerie personnelle gratuite sur http://www.hotmail.com >