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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL date parameter syntax 1

Status
Not open for further replies.
Aug 4, 2004
84
US
I have a select/where query with a few different conditions. I would like to have this query pull info between two entered dates. In normal design view in a query you would add Between [Enter Start Date] And [Enter Ending Date]. How would you put this as SQL?

thanks,

ab
 
I am now reduced to guessing what you are trying to achieve, is it:

SELECT [Confirm].[ID], [Confirm].[Fees], [Confirm].[Offlimits], [Confirm].[Office], [Confirm].[confirmation date]
FROM Confirm
WHERE (((Confirm.[Confirmation Date]) Between [Enter Start Date] And [Enter Ending Date]))
AND
(((([Confirm].[Fees])='Non-Standard') And (([Confirm].[Offlimits]) In ('std','none')))
OR
((([Confirm].[Fees])='Non-Standard') And (([Confirm].[Offlimits]) In ('non std')))
OR
((([Confirm].[Fees])='Standard') And (([Confirm].[Offlimits]) In ('std')))
OR
((([Confirm].[Fees])='Standard') And (([Confirm].[Offlimits]) In ('non std','none'))));

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Sorry for the trouble and thank you for the help Ken, thats it. I was using AND...silly. I need to get back into SQL, which will make figuring out these quries a heck of a lot easier.

cheers

ab
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top