J
Jay Kay
I have taken over an application that parses out data from a flat file. It
has been running in the UK without issue. I am in the US and am having
problems with a date field. I believe the issue is with datevalue().
The records are in the file in reverse date order. The records from Feb 29
thru Feb 13 process fine. When I get to Feb 12, I have an issue.
sRunDate ="20080212"
jobdate = DateValue(Right$(sRunDate, 2) & "/" & Mid$(sRunDate, 5, 2) & "/" &
Left$(sRunDate, 4))
When run in the UK (or when I set the short date format on my machine to
dd/mm/yy), jobdate evalutes to 2/12/08
When run with my short date format set to US, jobdate evaluates to 12/02/08
The odd thing is that when the sRunDate is something like "20080227", it
evaluates to 2/27/2008, as if it realizes that since 27 is not a valid month,
to flip-flop the month and day.
I don't want to have to change the date format on my machine every time I
need to run this. Is there a way to set the date format in the code? Or how
else can I go about correcting this?
Thanks
Regards
has been running in the UK without issue. I am in the US and am having
problems with a date field. I believe the issue is with datevalue().
The records are in the file in reverse date order. The records from Feb 29
thru Feb 13 process fine. When I get to Feb 12, I have an issue.
sRunDate ="20080212"
jobdate = DateValue(Right$(sRunDate, 2) & "/" & Mid$(sRunDate, 5, 2) & "/" &
Left$(sRunDate, 4))
When run in the UK (or when I set the short date format on my machine to
dd/mm/yy), jobdate evalutes to 2/12/08
When run with my short date format set to US, jobdate evaluates to 12/02/08
The odd thing is that when the sRunDate is something like "20080227", it
evaluates to 2/27/2008, as if it realizes that since 27 is not a valid month,
to flip-flop the month and day.
I don't want to have to change the date format on my machine every time I
need to run this. Is there a way to set the date format in the code? Or how
else can I go about correcting this?
Thanks
Regards