timamartin
asked on
Access 2007 query between two dates
This is the first time I have ever tried to query for something other than an exact value found in a table. I simply have 4 fields Name, Hours, StartDate, EndDate. I would like to be able to enter any of the following criteria and return records matching the criteria. My difficulty is that I don't know what to do for the dates. Do I need a table that will store these four values? Can I create a temporary variable? Where do I specify the search criteria? Query? Function?
Thanks in advance!
Thanks in advance!
ASKER
The original table has 10 fields I created a new table to store the user inputs that has 4+1 fields.
what are you wanting to query?
ASKER
I would like to search for all records between date "A" and date "B" as well as optionally name and hours.
select name, hours from table where startdate >= date and enddate<= date
ASKER
startdate >= date and enddate<= date
So where do the values stardate and enddate get stored prior to passing them to a query?
So where do the values stardate and enddate get stored prior to passing them to a query?
cdate is a function will help you build a date from string and the you can compare dates with it
try it
try it
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Ohhhhhh...I see. Thanks for your assistance that is what I need.
are the 4 fields in the same table?