Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

querying date in a range of dates

Status
Not open for further replies.

Leakyradiator

Technical User
Jul 12, 2002
35
0
0
US
I'm building a database of classic car parts dealers. A typical entry would read "Joe's Classic Car Parts" and "Ford Parts from 1903 to 1972"

I want to be able to return this record if someone does a search on "Ford Parts 1957"

How do I set up the date range of 1903 to 1972 in the database so that it'll be returned if someone does a search on any date within that range?

Thanks
 
if that's the text in one entry it'll take a good deal of parsing to get it to work. why not restructure your DB a little add two fields for your "earlyModel" and "lateModel". that way you can easily search for a date range.

Human beings, who are almost unique in having the ability to learn from the experience of others, are also remarkable for their apparent disinclination to do so.
-Douglas Adams (1952-2001)
 
Thanks for the input. I probably wasn't entirely clear in my question. I intend to put the beginning date in it's own field and the ending date in it's own field in the database. What I don't understand is how you search for a date range.

 
Have a select box where your user can choose what year they want to search for. Then in your query, you can do something like:
Code:
WHERE BeginningDate < #Form.Date#
AND EndDate > #Form.Date#
That's the basic idea, anyway.



Hope This Helps!

Ecobb

&quot;My work is a game, a very serious game.&quot; - M.C. Escher
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top