Access Dates

Dec 15
2008

This is a simple function I use to convert UK Dates to American dates for use in SQL statements in my access programs.

 
 
Function ActDate(passeddate As Date)
 
Dim SqlStrDate
Select Case Month(passeddate)
Case 1
  SqlStrDate = Day(passeddate) & "/Jan/" & Year(passeddate)
Case 2
  SqlStrDate = Day(passeddate) & "/Feb/" & Year(passeddate)
Case 3
  SqlStrDate = Day(passeddate) & "/Mar/" & Year(passeddate)
Case 4
  SqlStrDate = Day(passeddate) & "/Apr/" & Year(passeddate)
Case 5
  SqlStrDate = Day(passeddate) & "/May/" & Year(passeddate)
Case 6
  SqlStrDate = Day(passeddate) & "/June/" & Year(passeddate)
Case 7
  SqlStrDate = Day(passeddate) & "/July/" & Year(passeddate)
Case 8
  SqlStrDate = Day(passeddate) & "/Aug/" & Year(passeddate)
Case 9
  SqlStrDate = Day(passeddate) & "/Sept/" & Year(passeddate)
Case 10
  SqlStrDate = Day(passeddate) & "/Oct/" & Year(passeddate)
Case 11
  SqlStrDate = Day(passeddate) & "/Nov/" & Year(passeddate)
Case 12
  SqlStrDate = Day(passeddate) & "/Dec/" & Year(passeddate)
End Select
ActDate = SqlStrDate
End Function

If you need some help on a project drop leave a comment on the post and I will reply.