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

Can't select certain dates in query

Status
Not open for further replies.

Sylvialn

IS-IT--Management
Dec 28, 2000
101
US
I have a crosstab query. and I would like to be able to have the user enter the range of dates needed. Here's my query:

TRANSFORM Count(Donations.Key1) AS CountOfKey1
SELECT Patients.PatName, Bereaved.BName, Addresses.NamePrefix, Addresses.NameFirst, Addresses.NameLast, Addresses.AddrLine1, Addresses.AddrLine2, Addresses.AddrCity, Addresses.AddrState, Addresses.AddrZip, [AddrLine1]+" "+[AddrLine2] AS Address, [AddrCity]+", "+[AddrState]+" "+[AddrZip] AS CityStZip
FROM ((Donations INNER JOIN Patients ON Donations.InMemOf = Patients.PatName) INNER JOIN Bereaved ON Patients.PatID = Bereaved.PatID) INNER JOIN Addresses ON Bereaved.BName = Addresses.Key2
WHERE (((Donations.Date) Between #9/23/01# And #10/7/01#) AND ((Donations.LtrType)="M1M5") AND ((Bereaved.SeqNo)="1"))
GROUP BY Patients.PatName, Bereaved.BName, Addresses.NamePrefix, Addresses.NameFirst, Addresses.NameLast, Addresses.AddrLine1, Addresses.AddrLine2, Addresses.AddrCity, Addresses.AddrState, Addresses.AddrZip, [AddrLine1]+" "+[AddrLine2], [AddrCity]+", "+[AddrState]+" "+[AddrZip]
PIVOT Patients.PatID;


I tried putting Between [Enter start date: ] and [Enter end date: ]. Only this query won't let me..it gives me an error. How can I fix it so that I can have the user enter a range of dates? Does any one know how?? "Try everything at least once."
 
Whenever Access has to do grouping criteria can cause you trouble (crosstab queries and grouping in reports). Try making a query with the parameters that is a select query. Then make a crosstab based off this query. This is just one thought. When I run into this sort of weirdness I often try several things before I end up with something that works...
 
Thanks for the advice. I'll just keep trying! :) "Try everything at least once."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top