CDate

Does the date/time setting allow you to specify "." as the date separator?

The default Short Date format for Germany is dd.MM.yyyy
 
Also be aware when working in other regions, that the forward slash in the format string is actually a placeholder for the Regional Date Separator.

So in regions with a dot date separator (such as Germany) "dd/mm/yyyy" will be rendered as dd.MM.yyyy

This is why for international compatibility, when formatting dates for SQL commands, the format string should be:
Code:
"dd\/MM\/yyyy"
The backslash is the literal escape ensuring that the forward slash is used rather than the regional date separator.

BTW My preference is to include the hashes in the string rather than concatenating:
Code:
"\#dd\/MM\/yyyy\#"
 
It is working :)


CDate(REPLACE([p1ok],".","/"))

It was the solution :)

Thank you very much
 
Magnus - the reason why it would work in one system but not another MIGHT be a difference in the regional settings for WINDOWS (not an Access setting). Check those settings as a possible reason as to the difference in the two systems.
 

Users who are viewing this thread

Back
Top Bottom