A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

add column



 
 
Thread Tools Display Modes
  #1  
Old May 25th, 2004, 01:45 PM
Dan
external usenet poster
 
Posts: n/a
Default add column

is there a way to add columns in a query for example


Loan officer # Loans
Dan 2
Ed 3
Frank 8

is there a way to total these numbers up at the bottom?
  #2  
Old May 25th, 2004, 05:53 PM
Lynn Trapp
external usenet poster
 
Posts: n/a
Default add column

You can do something like this. The first query gets the name of the officer
and the count of each one's loans. The second query gets the total count of
all loans.

SELECT LoanOfficer, Count(LoanOfficer) AS NumberOfLoans
FROM Loans
GROUP BY LoanOfficer
UNION
SELECT "Total", Count(LoanOfficer)
FROM Loans;

--
Lynn Trapp
MS Access MVP
www.ltcomputerdesigns.com
Access Security: www.ltcomputerdesigns.com/Security.htm


"Dan" wrote in message
...
is there a way to add columns in a query for example


Loan officer # Loans
Dan 2
Ed 3
Frank 8

is there a way to total these numbers up at the bottom?



 




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 09:02 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.