Query - Extracting customers between two dates

icemac

Registered User.
Local time
Yesterday, 21:05
Joined
Jul 17, 2006
Messages
31
My customer searches hires a car between two dates - StartDate and EndDate. I want to build an expression that searches my database for all the customers currently using cars (using cars on the day of the search.) How can this be done?
 
Show the customers where (StartDate <= Now()) AND (EndDate >= Now()). In other words:

SELECT * FROM YOUR_CUSTOMER_TABLENAME WHERE YOUR_CUSTOMER_TABLENAME.StartDate <= Now() AND YOUR_CUSTOMER_TABLENAME.EndDate >= Now();

~Moniker
 
Moniker said:
Show the customers where (StartDate <= Now()) AND (EndDate >= Now()). In other words:

SELECT * FROM YOUR_CUSTOMER_TABLENAME WHERE YOUR_CUSTOMER_TABLENAME.StartDate <= Now() AND YOUR_CUSTOMER_TABLENAME.EndDate >= Now();

~Moniker

SELECT * From Your_Customer_TableName

WHERE Your_Customer_TableName.Customer and BETWEEN [StartDate] and [EndDate];

Where:
Your_Customer_TableName the name of your table
Your_Customer_TableName.Customer the field that Id's the customer
 
Last edited:

Users who are viewing this thread

Back
Top Bottom