PC Review


Reply
Thread Tools Rate Thread

Access query sum buy column

 
 
benjamin.fisk@gmail.com
Guest
Posts: n/a
 
      5th Sep 2008
ok here is what i am trying to do i am basicaly trying to create a
summary report in a qurry based on a table

Serial # Name(last) Name(first) Hours ID
AB000000 Doe john 5 1
AB000000 Doe john 1 2
AB000000 Doe john 2 3
AB000000 Doe john 8 4
AB000001 smith jane 7 5
AB000001 smith jane 1 6
AB000001 smith jane 2 7
AB000003 home jack 6 8
AB000003 home jack 9 9
AB000003 home jack 2 10
thats what it looks like right now in the qurrey

what i want is
Serial # Name(last) Name(first) Hours
AB000000 Doe john 16
AB000001 smith jane 10
AB000003 home jack 17


so that when some one has more then 40 hours worked i can sort them
out of the qurrey
i have been trying to play with sum and dsum but i always get a error
 
Reply With Quote
 
 
 
 
pietlinden@hotmail.com
Guest
Posts: n/a
 
      6th Sep 2008
On Sep 5, 5:53*pm, "benjamin.f...@gmail.com" <benjamin.f...@gmail.com>
wrote:
> ok here is what i am trying to do i am basicaly trying to create a
> summary report in a qurry based on a table
>
> Serial # * * * * *Name(last) *Name(first) *Hours * ID
> AB000000 * * *Doe * * * * * *john * * * * * * * 5 * * * 1
> AB000000 * * *Doe * * * * * *john * * * * * * * 1 * * * 2
> AB000000 * * *Doe * * * * * *john * * * * * * * 2 * * * 3
> AB000000 * * *Doe * * * * * *john * * * * * * * 8 * * * 4
> AB000001 * * *smith * * * * *jane * * * * * ** 7 * * * 5
> AB000001 * * *smith * * * * *jane * * * * * ** 1 * * * 6
> AB000001 * * *smith * * * * *jane * * * * * ** 2 * * * 7
> AB000003 * * *home * * * * *jack * * * * * * * 6 * * * 8
> AB000003 * * *home * * * * *jack * * * * * * * 9 * * * 9
> AB000003 * * *home * * * * *jack * * * * * * * 2 * * * 10
> thats what it looks like right now in the qurrey
>
> what i want is
> Serial # * * * * *Name(last) *Name(first) *Hours
> AB000000 * * *Doe * * * * * *john * * * * * * * 16
> AB000001 * * *smith * * * * *jane * * * * * ** 10
> AB000003 * * *home * * * * *jack * * * * * * * 17
>
> so that when some one has more then 40 hours worked i can sort them
> out of the qurrey
> i have been trying to play with sum and dsum but i always get a error


use a totals query.

SELECT [Serial #], [LastName], [FirstName], Sum(Hours) As TotalHours
FROM MyTable
GROUP BY [Serial #], [LastName], [FirstName];
 
Reply With Quote
 
benjamin.fisk@gmail.com
Guest
Posts: n/a
 
      9th Sep 2008
On Sep 5, 4:25*pm, "pietlin...@hotmail.com" <pietlin...@hotmail.com>
wrote:
> On Sep 5, 5:53*pm, "benjamin.f...@gmail.com" <benjamin.f...@gmail.com>
> wrote:
>
>
>
>
>
> > ok here is what i am trying to do i am basicaly trying to create a
> > summary report in a qurry based on a table

>
> > Serial # * * * * *Name(last) *Name(first) *Hours * ID
> > AB000000 * * *Doe * * * * * *john * * * * ** * 5 * * * 1
> > AB000000 * * *Doe * * * * * *john * * * * ** * 1 * * * 2
> > AB000000 * * *Doe * * * * * *john * * * * ** * 2 * * * 3
> > AB000000 * * *Doe * * * * * *john * * * * ** * 8 * * * 4
> > AB000001 * * *smith * * * * *jane * * * * * * * 7 * * * 5
> > AB000001 * * *smith * * * * *jane * * * * * * * 1 * * * 6
> > AB000001 * * *smith * * * * *jane * * * * * * * 2 * * * 7
> > AB000003 * * *home * * * * *jack * * * * * * * 6 * * * 8
> > AB000003 * * *home * * * * *jack * * * * * * * 9 * * * 9
> > AB000003 * * *home * * * * *jack * * * * * * * 2 * * * 10
> > thats what it looks like right now in the qurrey

>
> > what i want is
> > Serial # * * * * *Name(last) *Name(first) *Hours
> > AB000000 * * *Doe * * * * * *john * * * * ** * 16
> > AB000001 * * *smith * * * * *jane * * * * * * * 10
> > AB000003 * * *home * * * * *jack * * * * * * * 17

>
> > so that when some one has more then 40 hours worked i can sort them
> > out of the qurrey
> > i have been trying to play with sum and dsum but i always get a error

>
> use a totals query.
>
> SELECT [Serial #], [LastName], [FirstName], Sum(Hours) As TotalHours
> FROM MyTable
> GROUP BY [Serial #], [LastName], [FirstName];- Hide quoted text -
>
> - Show quoted text -


Thank you it worked wonders
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do i add the values of a column in a query in Access THPCT Microsoft Access Queries 3 16th Dec 2009 05:34 AM
ACCESS query column based on other value in query =?Utf-8?B?U3RldmUgRQ==?= Microsoft Access Queries 1 25th May 2006 12:16 AM
Query to access column names... =?Utf-8?B?RGVuaXNlIEdpYnNvbg==?= Microsoft Access Queries 3 18th Jan 2006 07:53 PM
Changing the default value of a column in Access using a SQL query =?Utf-8?B?QWxhbiBBcnNpbm93?= Microsoft Access Queries 1 10th May 2005 03:35 PM
Get column names from Access crosstab query via ADO? Michael Edwards Microsoft Access Queries 3 19th Mar 2004 05:17 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:46 PM.