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

MS Access technical tips

Visual FoxPro technical tips

General Tips

 

More tips from Alvechurch Data

Scope of a FoxPro command

Scope of a FoxPro command

Using While and For to control the scope of a FoxPro command

Read More

Full outer join in Access

Creating a full outer join in Access SQL

Read More

Types of SQL join

Types of join in a SQL query

Read More

Calculate - a native FoxPro alternative to SQL

The FoxPro Calculate() function - an alternative to SQL

Read More

FoxPro Gotcha

Common mistakes in Visual FoxPro

Read More