View Full Version : how to get data that crosses two dates


TNtangler
11-19-2008, 04:57 PM
I have a table that has multiple dates in one field and time in another field. What I'm trying to do is only extract data between 2 dates example today and tomorrow that has a start time say at 9pm to 6am the next day. I'm not sure if I'm asking this right. Any help would be greatly appreciated.....

Premy
11-19-2008, 06:53 PM
How about:

Select * FROM MyTable WHERE (MyDate BETWEEN [Date1] AND [Date2]) AND (MyTime BETWEEN [Time1] AND [Time2]);

The names within the brackets refer to controls (textboxes, comboboxes, etc.) on the form where u would enter these parameters and display the filtered data.

HTH

RossWindows
11-19-2008, 08:32 PM
Well, I think you might want to separate your dates into their own fields, or create a new linked table that stores the data for each date of each record.
If I understand correctly you might have a text string like "Date1 YadaYada Date2 BlahBlah etc" all in the same field
Is that right?