J
Jay
Hi all,
I'm working on formatting dates when parsing a file. I've run into a
problem when another user ran some report updates from their computer (when
it's usually done on mine), and the date format is completely off.
The date values are different, and I can't find a way to solve the problem.
Every test I've run keeps getting the same result.
The error:
I read a string value of 11/12/06 as 11/12/2006 (mm/dd/yyyy).
The other computer reads 11/12/06 as 12/6/2011 (mm/dd/yyyy).
I'm drawing a complete blank on how to solve this.
I've tried using CDate("11/12/06"). I have to parse the day/month/year
values from a larger string, so I am using variables. I can't find a way to
use date literals (#) when using string values.
Here's the things I've tried to do (some are probably dumb, but I was
desparate).
datestring = "11/12/06"
Date = CDate(datestring)
vMO = "11", vDY = "12", vYR = "06";
Date = vMO & "/" & vDY & "/" & vYR;
Date = "#" & vMO & "/" & vDY & "/" & vYR & "#";
datestring = "#" & vMO & "/" & vDY & "/" & vYR & "#";
Date = datestring;
Is there a way I can set individual parts of a date? like Month(ddate) =
"12";
Any help is appreciated. I'm stuck and I'm willing to try anything (except
do something on the other person's computer, because I can't).
Thanks,
Jay
I'm working on formatting dates when parsing a file. I've run into a
problem when another user ran some report updates from their computer (when
it's usually done on mine), and the date format is completely off.
The date values are different, and I can't find a way to solve the problem.
Every test I've run keeps getting the same result.
The error:
I read a string value of 11/12/06 as 11/12/2006 (mm/dd/yyyy).
The other computer reads 11/12/06 as 12/6/2011 (mm/dd/yyyy).
I'm drawing a complete blank on how to solve this.
I've tried using CDate("11/12/06"). I have to parse the day/month/year
values from a larger string, so I am using variables. I can't find a way to
use date literals (#) when using string values.
Here's the things I've tried to do (some are probably dumb, but I was
desparate).
datestring = "11/12/06"
Date = CDate(datestring)
vMO = "11", vDY = "12", vYR = "06";
Date = vMO & "/" & vDY & "/" & vYR;
Date = "#" & vMO & "/" & vDY & "/" & vYR & "#";
datestring = "#" & vMO & "/" & vDY & "/" & vYR & "#";
Date = datestring;
Is there a way I can set individual parts of a date? like Month(ddate) =
"12";
Any help is appreciated. I'm stuck and I'm willing to try anything (except
do something on the other person's computer, because I can't).
Thanks,
Jay