PDA

Click to See Complete Forum and Search --> : find records based on date


matcathy
Nov 23rd, 1999, 12:46 PM
Given two dates, start_date and end_date.
How can I retrieve all records from the database, a create_date attribute is specified in the table, that are within the given date interval?


e.g.
start_date = "8/13/1999"
end_date = "11/12/1999"

records to retrieve should be in the range of the two given date.


Thanks.

msdnexpert
Nov 23rd, 1999, 02:24 PM
Try this
Select * from abcd where efgh >= DateValue(startdate) and efgh <= datevalue(enddate)

efgh is the date field in the database

JorgeLedo
Nov 23rd, 1999, 10:39 PM
MSDNexpert was right but try it this way:

stdate= DateValue(start_date)
eddate= DateValue(end_date)

"Select * from abcd where efgh >= #" & stdate & "# and efgh <= #" & eddate & "#"

------------------
Jorge Ledo
j_ledo@hotmail.com
Portugal