By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,948 Members | 664 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,948 IT Pros & Developers. It's quick & easy.

adding date criteria to an existing query in SQL

P: 25
Hi,

i have the following SQL query and would like to add date criteria to it. the field being [Date] from the table [Tonnage] and the criteria being

Between [Forms]![Recycling Rates]![From Date] And [Forms]![Recycling Rates]![To Date]

query:
SELECT [TCode],
Sum(IIf([Recycling],[Tonnage],0)) AS RecycTonnage,
Sum([Tonnage]) AS TotTonnage,
(100*[RecycTonnage]/[TotTonnage]) AS RecycPC

FROM [tblTonnage]

GROUP BY [TCode]

ORDER BY (100*Sum(IIf([Recycling],[Tonnage],0))/Sum([Tonnage])) DESC
Sep 15 '08 #1
Share this Question
Share on Google+
1 Reply


P: 25
any attempt i make brings up and error message saying the quey is too complicated etc, try simplyfying it or adding parts to variables.
Sep 15 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.