Forum 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
Dates Changing in Access
Is there any way I can stop the dates from changing to American Format when exported from Access?For upcoming training course dates see: Pricing & availability
RE: Dates Changing in Access
Hi NicolaThanks 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 NicolaSorry 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 FunctionHope this helps, please follow up if you have any questions
Regards
Stephen
Wed 10 Mar 2010: Automatically marked as resolved.
|
|
» Forum post: Viewing |



Course updates

