[AccessD] Date Comparison Problem

Gustav Brock Gustav at cactus.dk
Tue Apr 4 11:53:39 CDT 2006


Hi Charlotte

Yes, right, lots of fun. 
And if such files are exported from a bank's mainframe the fun may rise to the next level!

/gustav

>>> cfoust at infostatsystems.com 04-04-2006 18:31:40 >>>
Thanks, Gustav.  Sorry I took so long to reply to this but I've been up
to my eyes in problems with a SQL backend.  Our code has to deal with
date strings brought in from a delimited text file and with converting a
date to a string for export in that format, as well as just handling the
data in the application.  When you look at a date string in a text file,
you have no idea what system date format is used or whether it is
compatible with the current date format, but we still have to convert
them to US format for use in SQL statements.  Since those dates may NOT
be formatted to the local settings, it can get very entertaining. ;->


Charlotte Foust

-----Original Message-----
From: accessd-bounces at databaseadvisors.com 
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock
Sent: Saturday, April 01, 2006 5:33 AM
To: accessd at databaseadvisors.com 
Subject: Re: [AccessD] Date Comparison Problem

Hi Charlotte

As soon as you have a Date value you cannot fail; all you have to is do
to apply the formatting and, using the principle in my StrDateSQL, no
local setting will influence that. It's foolproof.

However, to get to the Date value is another task and requires careful
handling. As you correctly point out, users can type anything.
For this purpose I would recommend the suggestion by Stuart, DateValue,
as it understands date expression strings formatted as to the local
settings.
Unfortunately, it understands more than that which can lead to
unpredictable results. How to avoid this, read on here:

http://databaseadvisors.com/pipermail/accessd/2004-December/029764.html 

/gustav

>>> cfoust at infostatsystems.com 31-03-2006 18:37:58 >>>
Oh, and we also have to deal with converting data between systems that
use different date formats and delimiters.  Start playing with languages
that use a dot as a date delimiter or a space. ;o> 





More information about the AccessD mailing list