[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index]
[Date Index]
[Thread Index]
[SQR-USERS Info]
[SQRUG Home Page]
Re: Bug in Date Handling
Hi Jay,
There is a pretty detailed discussion of this topic in the SQRUG archive
list. Check out this post and its thread:
http://www.sqrug.com/sqr-users/sqrusers/msg00101.html I think it may help.
Glenn
-----Original Message-----
From: Beller, Jay [mailto:JBeller@LBISOFTWARE.COM]
Sent: Thursday, April 12, 2001 1:32 PM
To: SQR-USERS@list.iex.net
Subject: Bug in Date Handling
Has anyone found SQR mishandling comparing two DATE fields when one of them
is the last day of a month and the other is the first day of the next month?
We're finding that SQR thinks these dates are the same - quite a serious
problem!
Here's a short program to demonstrate. If your version of SQR has the bug,
you should see every end-of-month date appear.
Thanks ... Jay Beller
===========================================
Begin-Setup
Declare-Variable
Date $CC_Curr_Date
Date $CC_Prev_Date
End-Declare
End-Setup
Begin-Program
do CC-Main
End-Program
Begin-Procedure CC-Main
SHOW 'Comparing Dates from 1/1/1999 forward...'
show '========================================================='
let #i = 0
let $CC_Prev_Date = strtodate( '01/01/1999', 'MM/DD/YYYY' )
while #i < 3000
let $CC_Curr_Date = dateadd( $CC_Prev_Date, 'DAY', 1 )
do compare-dates-wrong
add 1 to #i
let $CC_Prev_Date = $CC_Curr_Date
end-while
End-Procedure CC-Main
begin-procedure compare-dates-wrong
if $CC_Prev_Date = $CC_Curr_Date
show
$CC_Prev_Date edit 'MM/DD/YYYY HH:MI:SS am'
' = '
$CC_Curr_Date edit 'MM/DD/YYYY HH:MI:SS am'
else
if $CC_Prev_Date > $CC_Curr_Date
show
$CC_Prev_Date edit 'MM/DD/YYYY HH:MI:SS am'
' > '
$CC_Curr_Date edit 'MM/DD/YYYY HH:MI:SS am'
end-if
end-if
end-procedure