Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 17th, 2008, 04:08 PM
Authorized User
 
Join Date: Mar 2008
Location: , NJ, USA.
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default How can I make this query

Hi,

I have the following data
year race date starts track
2004 8/14/2004 1 freehold

i am trying to change this data base into this report format.

year type jan ..... dec total
2004 starts 1 ..... 5 6
2004 points 5 ...... 10 15

Would have months jan - dec in title. For starts you just count the number of times raced at the different tracks.
For points you only count each track/day once

I am using access 2007 to do this and I am not sure what the best way to proceed is.
Any help would be appreciated.
michael


 
Old March 19th, 2008, 05:54 AM
Friend of Wrox
 
Join Date: Oct 2007
Location: , , .
Posts: 130
Thanks: 0
Thanked 3 Times in 3 Posts
Send a message via AIM to urtrivedi
Default

Please specify what values(all possible values) starts and track field may contain.
and how u watn to show them in report.

Also when their is a date then why u have used separate year column.

urt

Help yourself by helping someone.
 
Old March 19th, 2008, 07:36 AM
Authorized User
 
Join Date: Mar 2008
Location: , NJ, USA.
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Rec No Race Date Track Code Race No Pole Position Driver Code Trainer Code
2 1/1/2002 F 1 2 31 4433
3 1/1/2002 F 1 3 498 3709
4 1/1/2002 F 1 5 794 674
5 1/1/2002 F 1 6 292 2858
6 1/1/2002 F 1 7 3489 1020
7 1/1/2002 F 1 8 1833 445
8 1/1/2002 F 2 1 1195 3667
9 1/1/2002 F 2 2 4580 4583
10 1/1/2002 F 2 3 700 580

this is the first few records in the database
the starts and year field are just sompthing i did in a query. realy the only fields that are needed is the date and driver/trainer fields.
with this sample data all 18 people would get 1 point and 1 start in jan 2002 if they had raced more than once on 1/1/2002 then they could have more than one start but would still have only 1 point. unless they raced at a different track on the same day.

 
Old March 19th, 2008, 05:13 PM
Authorized User
 
Join Date: Mar 2008
Location: , NJ, USA.
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default

was able to make 2 queries (one for trainer another for driver)
and use the sum function with grouping by date to get the totals into a new query and combine the 2 queries with a union query





Similar Threads
Thread Thread Starter Forum Replies Last Post
Make Table Query CongoGrey Access 2 June 1st, 2007 06:22 AM
how to make a query from an existing query raport SQL Language 3 November 13th, 2006 08:59 PM
Make table Query and Datepart marshaji Access 1 June 21st, 2005 12:36 PM
How to make a query to google? tqmk1982 BOOK: Beginning Java 2 1 March 26th, 2004 02:12 PM
Error on Make-Table Query In Union Query rylemer Access 1 August 20th, 2003 07:42 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.