473,401 Members | 2,125 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,401 software developers and data experts.

cross tab queries, Access, and date criteria

Im creating a cross tab query which sorts via [SteveCode] and sums the [Tonnage] for each type of [RecyType]. I want to be able to add a date criteria, so the user can specify that the query processes data between two dates.

I have looked long and hard on the net for any answers and it seems that this has appeared often but without a proper solution. I offer the following SQL of my query:

Code: ( text )
PARAMETERS [Forms]![Recycling Rates]![From Date] DateTime, [Forms]![Recycling Rates]![To Date] DateTime;
TRANSFORM Sum(Tonnage.Tonnage) AS SumOfTonnage
SELECT Tonnage.SteveCode
FROM Tonnage
WHERE (((Tonnage.SteveCode) Is Not Null) AND ((Tonnage.RecyType)="Dry (Recyclable)" Or (Tonnage.RecyType)="Green (Recyclable)" Or (Tonnage.RecyType)="Glass (Recyclable)" Or (Tonnage.RecyType)="Food (Recyclable)" Or (Tonnage.RecyType)="Residual") AND ((Tonnage.Date) Between [Forms]![Recycling Rates]![From Date] And [Forms]![Recycling Rates]![To Date]))
GROUP BY Tonnage.SteveCode
PIVOT Tonnage.RecyType;

If i change the two date parameters, the same results will show so it obviously is not working.

Any ideas?
Sep 15 '08 #1
0 1539

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

Similar topics

3
by: Metal Dave | last post by:
Hi all, Currently our product has a setup that stores information about transactions in a transaction table. Additionally, certain transactions pertain to specific people, and extra information...
6
by: Brad | last post by:
I have an sql query that has specific criteria (like state='PA' or state = 'NJ'...) and would like to be able to have the user specify the criteria dynamically either through the web or from...
1
by: EnriqueM | last post by:
One question: I created an access database that has been extremely useful in my work. I dont' even know at what level of knowledge I am at. I read a lot about how to create a database, created many...
4
by: bhbgroup | last post by:
I have a query on one large table. I only add one condition, i.e. a date (the SQL reads like 'where date > parameterdate'. This query is rather quick if 'parameterdate' is either explicitly...
12
by: Steve Elliott | last post by:
I have a query set up to gather together data between two specified dates. Shown in the query column as: Between #24/09/2004# And #01/10/2004# Is it possible to enter several different date...
3
by: Zlatko Matić | last post by:
Hello. I'm wondernig what is happennig whith saved pass-through queries nested in regular JET query if regular JET query just filtrates result by start/end date...Does pass-through query first...
10
by: aaronrm | last post by:
I have a real simple cross-tab query that I am trying to sum on as the action but I am getting the "data type mismatch criteria expression" error. About three queries up the food chain from this...
6
by: Joe | last post by:
Hi, I’ve lurked for a bit and certainly hope you folks can be as much help to me as you have been to others. My problem is basically trying to query several results in a single field (“or” type)...
0
MMcCarthy
by: MMcCarthy | last post by:
Rather than using the Access design view change the view to SQL. I am going to attempt to outline the general syntax used for SQL queries in Access. Angle brackets <> are used in place of some...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.