Article ID: 176572
Article Last Modified on 4/18/2003
SELECT * FROM Test WHERE MyDate BETWEEN CTOD('01/01/1997');
AND CTOD('01/01/2002')
SELECT * FROM Test WHERE MyDate BETWEEN ? and ?NOTE: The method only works if the application you are using in the front end supports passing parameters to the ODBC driver using the SQLBindParameter ODBC API.
{d '2000/01/01')
NOTE: This format works correctly for any dates less than 01/01/2000.
CREATE TABLE TEST (MyID c(10), MyDate d)
INSERT INTO TEST VALUES ('1',{01/01/1997})
INSERT INTO TEST VALUES ('2',{02/01/2001})
INSERT INTO TEST VALUES ('3',{10/22/2002})
DRIVER=Microsoft Visual FoxPro Driver;BACKGROUNDFETCH=NO;
SOURCETYPE=DBF; SOURCEDB=C:\MYPATH
SELECT * FROM TEST WHERE MyDate BETWEEN ;
{d '01/01/1996'} and {d '01/01/2000'}
This query returns the one record that matches the criteria:
SELECT * FROM TEST WHERE MyDate BETWEEN ;
{d '01/01/1996'} and {d '12/31/1999'}
NOTE: If the application you are using does not support multi-line SQL statements without a line continuation character, please make sure to insert the appropriate line continuation character after the word BETWEEN in both SQL statements.Additional query words: Date
Keywords: kbbug kbfix kbvs600fix kbdriver KB176572