Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Summarize by Date in Access Query

Posted on 2012-08-21
5
Medium Priority
?
364 Views
Last Modified: 2012-08-21
Hi all,

I am doing a query (please see picture for where I stand)

What I really want to do is summarize origin & destination columns data by each date

There are 12 unique origin and destin for each date

eg:

Trip Date              ORIGIN        DESTIN                            

2/07/2012            TO                 VA
2/07/2012            TO                 CA
2/07/2012            TO                 ED
2/07/2012            TO                 WI
2/07/2012            TO                 OTHER
2/07/2012            ML                 VA
2/07/2012            ML                 CA
2/07/2012            ML                 ED
2/07/2012            ML                 WI
2/07/2012            ML                 OTHER
2/07/2012            REST              REST

How do I go on to summarize the data by date from this point on?

Any help in correct step is much appreciated!
Temp.PNG
0
Comment
Question by:Shanan212
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 40

Expert Comment

by:als315
ID: 38317439
Can you show expected result?
0
 
LVL 22

Expert Comment

by:Flyster
ID: 38317552
If you're looking for a count of each unique value, you can use this:

SELECT YourTable.[Trip Date], YourTable.[ORIGIN], YourTable.[DESTIN], Count(YourTable.ORIGIN) AS CountOfORIGIN
FROM YourTable
GROUP BY YourTable.[Trip Date], YourTable.[ORIGIN], YourTable.[DESTIN];

Flyster
0
 
LVL 13

Author Comment

by:Shanan212
ID: 38317593
The expected result is this

2/07/2012            TO                 VA
2/07/2012            TO                 CA
2/07/2012            TO                 ED
2/07/2012            TO                 WI
2/07/2012            TO                 OTHER
2/07/2012            ML                 VA
2/07/2012            ML                 CA
2/07/2012            ML                 ED
2/07/2012            ML                 WI
2/07/2012            ML                 OTHER
2/07/2012            REST              REST

My current results are in the screenshot

Flyster, its not nessarily unique value as for each date, there is are multilple "TO" as origin and "VA" available (example)
0
 
LVL 22

Accepted Solution

by:
Flyster earned 2000 total points
ID: 38317741
The code I provided will give you that result with the addition of a count field which tells you how many such entries exists. If you don't need the count, you can use this:

SELECT YourTable.[Trip Date], YourTable.ORIGIN, YourTable.DESTIN
FROM YourTable
GROUP BY YourTable.[Trip Date], YourTable.ORIGIN, YourTable.DESTIN;
0
 
LVL 13

Author Closing Comment

by:Shanan212
ID: 38317785
That works! Thanks!
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question