Hi Barry,
Unless I am mis-understanding your example, you appear to be doing this
comparison using external format dates which is doomed to failure.
They will be compared as simple character strings, left to right, until a
difference is found. You need to do the comparison with an internal day
number.
Martin Phillips
Ladybridge Systems Ltd
17b Coldstream Lane, Hardingstone, Northampton NN4 6DB, England
+44 (0)1604-709200
-----Original Message-----
From: Barry Rogen
Sent: Tuesday, January 24, 2012 1:17 PM
To: U2 Users List (u2-users@listserver.u2ug.org)
Subject: [U2] Date comparison
We have been experiencing this quite a bit and am not sure why we are
getting mis-comparisions. Below is a simplified example of our issue
B$CHECK.855.SENT: 51: IF ST.DATE # "" THEN
B$CHECK.855.SENT: 52: IF ST.DATE < "12-31-11" THEN
B$CHECK.855.SENT: 53: PRINT PL:"Date is less than
12-31-11...":
: ST.DATE/
STRING: T r L=8 `01-20-12'
We have this issue with programs and with SELECT statements throughout.
When you qualify a date for this year to a date from 2011 it screws up.
Barry Rogen
Senior Programmer/Analyst
PNY Technologies, Inc.
(973) 560-5327
bro...@pny.com<mailto:bro...@pny.com>
------------------------------------------------------------------------------------------------------------------------
We are continually faced with great opportunities brilliantly
disguised as insoluble problems.
John W Gardner
------------------------------------------------------------------------------------------------------------------------
[http://thinkbeforeprinting.org/struct/signature-1.gif]
________________________________
NOT INTENDED AS A SUBSTITUTE FOR A WRITING
NOTHING IN THIS E-MAIL, IN ANY E-MAIL THREAD OF WHICH IT MAY BE A PART, OR
IN ANY ATTACHMENTS THERETO, SHALL CONSTITUTE A BINDING CONTRACT, OR ANY
CONTRACTUAL OBLIGATION BY PNY, OR ANY INTENT TO ENTER INTO ANY BINDING
OBLIGATIONS, NOTWITHSTANDING ANY ENACTMENT OF THE UNIFORM ELECTRONIC
TRANSACTIONS ACT, THE FEDERAL E-SIGN ACT, OR ANY OTHER STATE OR FEDERAL LAW
OF SIMILAR SUBSTANCE OR EFFECT. THIS EMAIL MESSAGE, ITS CONTENTS AND
ATTACHMENTS ARE NOT INTENDED TO REPRESENT AN OFFER OR ACCEPTANCE OF AN OFFER
TO ENTER INTO A CONTRACT. NOTHING IN THIS E-MAIL, IN ANY E-MAIL THREAD OF
WHICH IT MAY BE A PART, OR IN ANY ATTACHMENTS THERETO SHALL ALTER THIS
DISCLAIMER.
This e-mail message from PNY Technologies, Inc. is for the sole use of the
intended recipient(s) and may contain confidential and privileged
information. Any unauthorized review, use, disclosure or distribution is
prohibited. If you are not the intended recipient, please contact the sender
by reply e-mail and destroy all copies of the original message.
_______________________________________________
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users
_______________________________________________
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users