[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

Re: Issue with Date Comparisons in SQR



If you are going against Oracle, you need to put your date string into date
format with
the to_date function, i.e., If (&effdt=to_date('31-jan-2000','dd-mon-yyyy')

-----Original Message-----
From: tina rao [mailto:rao_tina@HOTMAIL.COM]
Sent: Thursday, March 21, 2002 1:22 PM
To: SQR-USERS@list.iex.net
Subject: Issue with Date Comparisons in SQR


***************************************************
Hi,
I am facing a weird problem with date comparison in an sqr -
My code is something like this -
========================
Begin-Select
EMPLID
EFFDT

   If (&EFFDT <= '31-JAN-2001')
      LET $emplid = &EMLID
       show $emplid
   end-if
from ps_EMPLOYEES
End-Select
=========================

For some reason, the IF condition is returning True even when the EFFDT
value is '01-FEb-2001' !!
I tried testing the code by changing 31-JAN-2001 to 28-FEB-2001 and the sqr
returned records with EFFDT '01-MAR-2001' !! This happens only when the date
on the right is the last day of the month. ALso, Only the Records with EFFDT
as of the 1st day of the next month are returned.
Has anyone ever faced this problem? Any help would be greatly appreciated.

Thanks,
Tina.
****************************************************************

_________________________________________________________________
Join the world's largest e-mail service with MSN Hotmail.
http://www.hotmail.com