98.7% Of all customers recommend us, we're so confident about our results we publish all reviews and stats
View Live Stats View ReviewsForum home » Delegate support and help forum » Microsoft Access VBA Training and help » Dates Changing in Access
Dates Changing in Access
Resolved · Low Priority · Version 2003
Nicola has attended:
Access Introduction course
Access Intermediate course
Access Advanced course
Access VBA course
Dates Changing in Access
Is there any way I can stop the dates from changing to American Format when exported from Access?
RE: Dates Changing in Access
Hi Nicola
Thanks for your question
This can be done by using a combination of datepart() functions, string cocatenation, and cdate functions to format the date correctly.
I will write a some code to solve this and will post it here later today or tommorrow
Regards
Stephen
RE: Dates Changing in Access
Hi Nicola
Sorry for the delay in following up
I have written a function which converts the date into UK format. When you pass the calendar's value to a variable you should pass the value as the USdate argument in the function
Public Function DateConverter(USDate As String) As Date
Dim strMonth As String
Dim strDay As String
Dim strYear As String
Dim strDate As String
strDay = DatePart("d", USDate)
strMonth = DatePart("m", USDate)
strYear = DatePart("yyyy", USDate)
strDate = strDay & "/" & strMonth & "/" & strYear
DateConverter = CDate(strDate)
End Function
Hope this helps, please follow up if you have any questions
Regards
Stephen
Wed 10 Mar 2010: Automatically marked as resolved.
Training information:
Welcome. Please choose your application (eg. Excel) and then post your question. Our Microsoft Qualified trainers will then respond within 24 hours (working days). Frequently Asked Questions
Any suggestions, questions or comments? Please post in the Improve the forum thread. |