Date...

dl41001

Registered User.
Local time
Today, 13:05
Joined
Apr 18, 2001
Messages
17
Hi,
I want to create a report showing 'From:' [date_posted] 'To:' [date_posted].
The users will enter: ex: 12-01-01 and 12-20-01 which exist in the main_tbl to inquire info in that time frame.
This is the query:
SELECT location, sum (amount)
FROM main_tbl
WHERE [date_posted] between [Enter Beginning Date] and [Enter Ending Date]
GROUP BY location
ORDER BY sum (amount) DESC;
If you put it in Access, it'll work fine... but I can't have the dates (from...to...) shown on report as stated above.
Is my question clear?
Pls show me.
Thank you very much.
Happy Holidays!!!
 
SELECT location, [Enter Beginning Date] As BegDt, [Enter Ending Date] As EndDt, Sum(amount) As SumAmt
FROM main_tbl
WHERE [date_posted] between [Enter Beginning Date] and [Enter Ending Date]
GROUP BY location,[Enter Beginning Date], [Enter Ending Date]
ORDER BY sum (amount) DESC;

You will now have the date fields in every row of the recordset so they will be available for the report. Just make sure that the references are identical in all three places or you will end up with multiple prompts.
 
It's perfect! I thought of that but I didn't put it right in codes...
Thank you so very much.
Have a Merry Xmas and Happy New Year!!!
 

Users who are viewing this thread

Back
Top Bottom