Обсуждение: Date: the day before yesterday.
I am trying to retrieve records generated in the passed two days and encountered difficulties in dealing with the date in Oracle. Here is the query I try to form: select * from Table where InputDate>=[the day before yesterday] I tried "sysdate-2", didn't work. Any suggestions? Thanks! Jason
I am not sure if this will work with Oracle. I would like to know, so if you could try out this test : http://www.foxforum.com/showfullmessage.cfm?messageID=12382 If it does work, then you should be able to do this: ldDby = date()-2 lnRet = sqlexec( h, "select * from Table where InputDate>=?ldDby" ) Carl Karsten "Jason" <jzhu@dental.temple.edu> wrote in message news:9l19vh$9ku$1@cronkite.temple.edu... > I am trying to retrieve records generated in the passed two days and > encountered difficulties in dealing with the date in Oracle. > Here is the query I try to form: > > select * from Table where InputDate>=[the day before yesterday] > > I tried "sysdate-2", didn't work. > Any suggestions? > Thanks! > > Jason > > >
Jason wrote: > I am trying to retrieve records generated in the passed two days and > encountered difficulties in dealing with the date in Oracle. > Here is the query I try to form: > > select * from Table where InputDate>=[the day before yesterday] > > I tried "sysdate-2", didn't work. > Any suggestions? Try harder. > Thanks! You're welcome. Jan PS: What about ('now'::date - 2) ? -- #======================================================================# # It's easier to get forgiveness for being wrong than for being right. # # Let's break this rule - forgive me. # #================================================== JanWieck@Yahoo.com # _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com