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."
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"
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."