Hi,
This one has me stuck. Heres the test data in the table :
Name StartDate
------- ----------
Richard 03/05/2003
John 04/05/2003
Jo 06/05/2003
Steve 07/05/2003
Harry 05/06/2003
Sammy 05/06/2003
Ted 09/06/2003
One of my developers asked me why does Statement A return different rows from Statement B ? (date format is dd/mm/yyyy)
Statement A:
SELECT * FROM Table1
WHERE startdate >= #03/05/2003# and startdate <= #05/06/2003#
Results:
Name StartDate
Richard 03/05/2003
John 04/05/2003
Jo 06/05/2003
(wheres sammy, steve and harry ? )
Statement B:
SELECT * FROM Table1
WHERE startdate >= datevalue('03/05/2003') and startdate <= datevalue('05/06/2003')
Results:
Name StartDate
Richard 03/05/2003
John 04/05/2003
Sammy 05/06/2003
Jo 06/05/2003
Steve 07/05/2003
Harry 05/06/2003
(using msaccess 2k, win2k)
thanks in advance.
This one has me stuck. Heres the test data in the table :
Name StartDate
------- ----------
Richard 03/05/2003
John 04/05/2003
Jo 06/05/2003
Steve 07/05/2003
Harry 05/06/2003
Sammy 05/06/2003
Ted 09/06/2003
One of my developers asked me why does Statement A return different rows from Statement B ? (date format is dd/mm/yyyy)
Statement A:
SELECT * FROM Table1
WHERE startdate >= #03/05/2003# and startdate <= #05/06/2003#
Results:
Name StartDate
Richard 03/05/2003
John 04/05/2003
Jo 06/05/2003
(wheres sammy, steve and harry ? )
Statement B:
SELECT * FROM Table1
WHERE startdate >= datevalue('03/05/2003') and startdate <= datevalue('05/06/2003')
Results:
Name StartDate
Richard 03/05/2003
John 04/05/2003
Sammy 05/06/2003
Jo 06/05/2003
Steve 07/05/2003
Harry 05/06/2003
(using msaccess 2k, win2k)
thanks in advance.