473,395 Members | 1,497 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,395 software developers and data experts.

Query Help

Thanks for reading...I need all the suggestions I can get.
Access 2000 db.
We have project with 10 categories - each with their own set of criteria (txt or values that need to be met by customers).
Query Cols are: Acct #, Name, Start Date, Category, Jan07...Dec08 (etc.)
Start dates are staggered.
At any given time, I need a count of the values that have met the criteria for at least 6 months.
(For instance, if Cust ABC started the program in May '07, they have until
April 30, 2008 to reach the criteria for Category X six times - how many times have they met the criteria as of today?)
I figure I need to keep each category in a separate query, then combine the results in a report....any ideas on the calculation?
I've tried turning values into 1 & 0's and summing, but the variable start date is making it messy.
Thanks for the help.
Jan 24 '08 #1
3 967
nico5038
3,080 Expert 2GB
Your problem is cause by the table design:

Query Cols are: Acct #, Name, Start Date, Category, Jan07...Dec08 (etc.)

The Jan07.. Dec08 shouldn't be in one row.
Best to transform your table to:
Acct #, Name, Start Date, Category, YearMonth, other fields.

This will allow an easy filter on the needed period by using e.g. a
WHERE YearMonth Between '200701' and '200708'

Getting the idea ?

Nic;o)
Jan 28 '08 #2
Nico; thanks. Unfortunately, the data is being pulled in from a Notes db which is in that format; I was hoping to avoid having to write code to transpose the data. As it is, I'm having to write an enormous amount of code to translate the data as much of it is values such as "1:28" or "1:45" - which come in as date/time - rather than comparitive values. I'll just have to deal with it....! Thanks again.


Your problem is cause by the table design:

Query Cols are: Acct #, Name, Start Date, Category, Jan07...Dec08 (etc.)

The Jan07.. Dec08 shouldn't be in one row.
Best to transform your table to:
Acct #, Name, Start Date, Category, YearMonth, other fields.

This will allow an easy filter on the needed period by using e.g. a
WHERE YearMonth Between '200701' and '200708'

Getting the idea ?

Nic;o)
Jan 30 '08 #3
nico5038
3,080 Expert 2GB
There's a way to "normalize" the data using a UNION query like:
Expand|Select|Wrap|Line Numbers
  1. select acct#, '200701' as YearMonth, Jan07 as Value from tblX
  2. UNION
  3. select acct#, '200702' as YearMonth, Feb07 as Value from tblX
  4. UNION
  5. select acct#, '200703' as YearMonth, Mar07 as Value from tblX
  6. UNION
  7. etc...
  8.  
The result can be used or stored in a (temp) table. Perhaps that can save some coding.

Nic;o)
Jan 30 '08 #4

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

Similar topics

9
by: netpurpose | last post by:
I need to extract data from this table to find the lowest prices of each product as of today. The product will be listed/grouped by the name only, discarding the product code - I use...
7
by: Simon Bailey | last post by:
How do you created a query in VB? I have a button on a form that signifies a certain computer in a computer suite. On clicking on this button i would like to create a query searching for all...
4
by: d.p. | last post by:
Hi all, I'm using MS Access 2003. Bare with me on this description....here's the situation: Imagine insurance, and working out premiums for different insured properties. The rates for calculating...
4
by: Alan Lane | last post by:
Hello world: I'm including both code and examples of query output. I appologize if that makes this message longer than it should be. Anyway, I need to change the query below into a pivot table...
36
by: Liam.M | last post by:
hey guys, I have one last problem to fix, and then my database is essentially done...I would therefore very much appreciate any assistance anyone would be able to provide me with. Currently I...
5
by: elitecodex | last post by:
Hey everyone. I have this query select * from `TableName` where `SomeIDField` 0 I can open a mysql command prompt and execute this command with no issues. However, Im trying to issue the...
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...
11
by: funky | last post by:
hello, I've got a big problem ad i'm not able to resolve it. We have a server running oracle 10g version 10.1.0. We usually use access as front end and connect database tables for data extraction....
4
by: Doris | last post by:
It does not look like my message is posting....if this is a 2nd or 3rd message, please forgive me as I really don't know how this site works. I want to apologize ahead of time for being a novice...
6
by: jsacrey | last post by:
Hey everybody, got a secnario for ya that I need a bit of help with. Access 97 using linked tables from an SQL Server 2000 machine. I've created a simple query using two tables joined by one...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.