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

adding date criteria to an existing query in SQL

P: 25

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]

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

FROM [tblTonnage]


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.