Heys. I have an issue with my VBA tool regarding dates. It is an issue which only popped up after the Access Database was distributed to different countries around the world. The date format is different on each of those regions, causing malfunctioning scripts all around.
In Eastern Europe they use dots as separators, in Western Europe dashes and in the United states slashes. And as if this is not enough, also the order of day and month differ.
The Access database has a datepicker text field where the user can choose the desired date. The date is then compared to dates in the database, after which a query is run and a datasheet shown. To solve this issue I'm considering multiple options, but I hoped that ppl in here had some experience with this issue and could advice me on what solution worked best for them. Two of the solutions I'm thinking about are:
- Using the FORMAT() function in all the queries to ensure the format is the way I want it to be
- Creating a public function which converts dates by the use of Replace() and CDate() and returns them in the right format
I'm a bit affraid that I might not have a full overview of the different date formats and orders out there and thus will have trouble finding a common solution for this issue.
Thanks in advance
In Eastern Europe they use dots as separators, in Western Europe dashes and in the United states slashes. And as if this is not enough, also the order of day and month differ.
The Access database has a datepicker text field where the user can choose the desired date. The date is then compared to dates in the database, after which a query is run and a datasheet shown. To solve this issue I'm considering multiple options, but I hoped that ppl in here had some experience with this issue and could advice me on what solution worked best for them. Two of the solutions I'm thinking about are:
- Using the FORMAT() function in all the queries to ensure the format is the way I want it to be
- Creating a public function which converts dates by the use of Replace() and CDate() and returns them in the right format
I'm a bit affraid that I might not have a full overview of the different date formats and orders out there and thus will have trouble finding a common solution for this issue.
Thanks in advance
Last edited: