Date formats used by Access SQL

Regardless of the regional settings of your PC, you must provide dates in US format for SQL statements in VBA. Use the following simple function to convert a UK date into a US-format date:

Function SQLDate (ByVal MyDate As Variant) As String
   SQLDate = "#" & Format(MyDate,"mm/dd/yyyy") & "#"
End Function

Further information in the Microsoft Knowledge Base: Q149095 ACC

Access Tips

FoxPro Tips

General Tips

 

Related Items

Calculate - an alternative to SQL

The Calculate() function - an alternative to SQL

Read More

FoxPro Gotcha

Common mistakes in Visual FoxPro

Read More

Creating a FoxPro array with SQL

Use _TALLY to avoid problems when you create an array of data with SQL in FoxPro.

Read More

Migrating to Access 2002

Migrating to Access 2002 from earlier versions of the database

Read More

SQL Subqueries in Microsoft Access

Using SQL queries and subqueries in Microsoft Access

Read More