The Following was downloaded from CodeCentral:
Resolving Date Problem in SQL!
No Special Terms
Use a number (as date value) in SQL text
Use a number (as date value) in SQL text.
'SELECT * FROM Country WHERE Date1=36736'
Actually, a date value is a number.
So, #07.29.2000# = 36736.
If you find a date value as a number then can use FormatFloat
str1=FormatFloat('#', Date) //str1='36736'
Query1.SQL.Text= 'SELECT * FROM Country WHERE Date1=' +
Note: This solution is properly work BDE, VB, MS-Access, MS-SQL.
Yet somehow, I cannot get this to work, and dates in SQL are always a
problem. Users may have their date settings differently.
Is there a solution to this problem that will always work for dates in
SQL, irrespective of the users settings?