Microsoft Developer Network >
Forums Home
>
Microsoft ISV Community Center Forums
>
Visual Basic for Applications (VBA)
>
trouble with datediff in access 2003
trouble with datediff in access 2003
- When I have designed access 2003 app, users input the date the in the following format, mm/dd/yyyy since access did not allow dd/mm/yyyy since all of the math that access does is based on month day year. But my client is french and wants to enter the date based on french format. which is day month year, dd/mm/yyyy.
My trouble comes from : Expr1: DateDiff("d",Date(),[Expiry Date]).
I use this to compare to dates, but it compares thinking that month is first when it is actually day. How can I change it thinking that the first part is day instead of month.
I know that I should switch out of access 2003, but I cant at the moment.
Thank you!
Answers
- I have been suggested to use CDATE function, and it seems it did the job. Going to test it out and see how well it does.
- Marked As Answer byTwilightBrigade Wednesday, October 28, 2009 2:44 AM
All Replies
- Hi,
how is set the international format for Date in the system of your customer?
Have you tryed with:
DateDiff("d",Date(),DateValue([Expiry Date]))?
Cinzia
Sito RIO
Il mio Blog - When I have designed access 2003 app, users input the date the in the following format, mm/dd/yyyy since access did not allow dd/mm/yyyy since all of the math that access does is based on month day year. But my client is french and wants to enter the date based on french format. which is day month year, dd/mm/yyyy.
My trouble comes from : Expr1: DateDiff("d",Date(),[Expiry Date]).
I use this to compare to dates, but it compares thinking that month is first when it is actually day. How can I change it thinking that the first part is day instead of month.
I know that I should switch out of access 2003, but I cant at the moment.
Thank you!
i THING YOU SHOULD USE CULTUERINF...
IF you client lives in france its means is software is in french you ganna get trouble when you deploy it...why not to use ms 2003 that is in french...
Don't judge me, just Upgrade me. Thanks! - My customer has an English copy of office 2003, and he is Quebec. But that is not the issue, all of papers and documents are day/month/year. I cannot tell my client "Listen to correct the issue, you should buy a french copy for the whole office". You'll know what will happen next.
DateValue returns computer date, which is set to international format, it does not make any difference.
I have been thinking, if I would create a funtionc mydate(), that would return the date in dd/mm/yyyy. Would I be still be able to call it in a query. and would DateDiff still work.
I need to make access2003 application to work independent of the computer configuration and language. - I have been suggested to use CDATE function, and it seems it did the job. Going to test it out and see how well it does.
- Marked As Answer byTwilightBrigade Wednesday, October 28, 2009 2:44 AM

