Full Version: inserting date in query reversing the day with month
UtterAccess Discussion Forums > Microsoft® Access > Access Date + Time
Lynn101
Hi,
I have a query which inserts dates. I receive the dates in this format: 20040901 - yyyymmdd.
I send this date to a query "buildDate" which does this:
Function buildDate(ByVal oldString As String) As Variant
Dim d, m, y As Integer
d = Mid(oldString, 7, 2)
m = Mid(oldString, 5, 2)
y = Left(oldString, 4)
buildDate = DateSerial(y, m, d)
End Function

The result works well, however when i insert the result from buildDate into a table, it inserts it as u.s dates - 09/01/04
How do I fix this???????
Lynn
Candace Tripp
You have your field defined as a Date/Time and your desktop defaults set to US formatted dates.

You can try setting the formated on the Date/Time field to the format you wish.
Lynn101
My regional settings dates are formatted to dd/mm/yyyy - english
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.