S
Starry
Hi
Despite reading all I can I cannot seem to work around this.
My query is flipping ambiguous dates to US format. If it is passed a date of
say 23/08/2009 it works fine but given the following or anything where the
date and month can be changed it does! How can I prevent this? All related
fields etc are set as UK.
Query is as follows:
dteWeekend = .......object resulting in 06/09/2009.....
strsql = "SELECT Jobdata.Labname"
strsql = strsql & " FROM Jobs LEFT JOIN Jobdata ON Jobs.JobNumber =
Jobdata.JobNumber"
strsql = strsql & " GROUP BY Jobdata.Labname, Jobdata.Labweek,
Jobs.Complete"
strsql = strsql & " HAVING (((Jobdata.Labname) Is Not Null) AND
((Jobdata.Labweek) = #" & dteWeekend & "#) AND ((Jobs.Complete) = False));"
Resulting SQL...which is fine:
SELECT Jobdata.Labname FROM Jobs LEFT JOIN Jobdata ON Jobs.JobNumber =
Jobdata.JobNumber GROUP BY Jobdata.Labname, Jobdata.Labweek, Jobs.Complete
HAVING (((Jobdata.Labname) Is Not Null) AND ((Jobdata.Labweek) =
#06/09/2009#) AND ((Jobs.Complete) = False));
But then when pasted into the grid or run from within my code the date flips
to 09/06/2009.
I discovered one thread where the solution was to use dd/mm/yy throughout
but this affects other aspects and would create significant work.
How can I stop this any ideas?
Access2003 uk settings
Despite reading all I can I cannot seem to work around this.
My query is flipping ambiguous dates to US format. If it is passed a date of
say 23/08/2009 it works fine but given the following or anything where the
date and month can be changed it does! How can I prevent this? All related
fields etc are set as UK.
Query is as follows:
dteWeekend = .......object resulting in 06/09/2009.....
strsql = "SELECT Jobdata.Labname"
strsql = strsql & " FROM Jobs LEFT JOIN Jobdata ON Jobs.JobNumber =
Jobdata.JobNumber"
strsql = strsql & " GROUP BY Jobdata.Labname, Jobdata.Labweek,
Jobs.Complete"
strsql = strsql & " HAVING (((Jobdata.Labname) Is Not Null) AND
((Jobdata.Labweek) = #" & dteWeekend & "#) AND ((Jobs.Complete) = False));"
Resulting SQL...which is fine:
SELECT Jobdata.Labname FROM Jobs LEFT JOIN Jobdata ON Jobs.JobNumber =
Jobdata.JobNumber GROUP BY Jobdata.Labname, Jobdata.Labweek, Jobs.Complete
HAVING (((Jobdata.Labname) Is Not Null) AND ((Jobdata.Labweek) =
#06/09/2009#) AND ((Jobs.Complete) = False));
But then when pasted into the grid or run from within my code the date flips
to 09/06/2009.
I discovered one thread where the solution was to use dd/mm/yy throughout
but this affects other aspects and would create significant work.
How can I stop this any ideas?
Access2003 uk settings