Question : Access Date Formats: USA to European

When using Access 97 Functions Eg. DLookup and using a Date Criteria you have to use the Date format as USA.  Similarly with any Access SQL.

BUT in some situations Eg. Using Form Variables, I have found that using the European/UK format i.e. DD/MM/YYYY is necessary and not USA - this is confusing!  

Does anybody have a difintive statement as to when to use Dates with USA and when to use Regional/UK?

Thanks for any help in clarifying this matter.

Answer : Access Date Formats: USA to European

Here is my solution, I use it for years.

Function us_date(d As Variant)
  On Error Resume Next
  Dim mydate As Variant
  Dim mywhere As String
  Dim dd As String
  Dim mm As String
  Dim yy As String
 
  dd = DatePart("d", d)
  mm = DatePart("m", d)
  yy = DatePart("yyyy", d)

  us_date = "#" & mm & "/" & dd & "/" & yy & "#"
 
End Function


if still any problems, mail me.
good luck

Ronen.

Random Solutions  
 
programming4us programming4us