473,503 Members | 4,272 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Consolidate information from multiple rows into one row

1 New Member
Hi,
I have a view which selects these columns: employeenumber,ClientID,Billing code,amountBilled,InvoiceNumber from a number of other tables.

One Employee may have many billingAmounts.
My view right now has each row for every Amount Billed for each Employee.I want to have a query which has only one row for each employee with repeating cloumns if they have multiple billings.

If an employee A has one row in the view,i want my output in this format.
EmployeeNumber,ClientID,BillingCode1,AmountBilled1 ,InvoiceNumber1

If an employee A has two rows in the View,i want my output in this format.
EmployeeNumber,ClientID,BillingCode1,AmountBilled1 ,InvoiceNumber1,BillingCode2,AmountBilled2,Invoice Number2

If an employee A has three rows in the View,i want my output in this format.
EmployeeNumber,ClientID,BillingCode1,AmountBilled1 ,InvoiceNumber1,BillingCode2,AmountBilled2,Invoice Number2,BillingCode3,AmountBilled3,InvoiceNumber3
etc..

I do not know in advance the maximum number of Invoices a employee may have.There is no fixed limit on this.however,i have noticed in my database that we do not have more than 5 till date.

How can I write a query to accomplish this?Please help.
Jul 5 '06 #1
1 2832
gt6062b
2 New Member
I'm also interested in a solution to this type of problem.

I have a project with multiple committees (title, date) where there can be a maximum of 6 committees for a given project.

I tried to use rownum to do this, but ran into a problem where I pull only the first 6 committee titles/dates into my extract.

Bumping this one to hope that it can get a response.

Thanks,

GT
Nov 22 '06 #2

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

Similar topics

3
3990
by: Andrew Chanter | last post by:
I have a table containing multiple records per key. eg: 1 | John Smith 1 | Mary Brown 1 | Julie Grey 2 | Danny Pink 2 | Jill White I need to consolidate this into a single record for each...
1
1624
by: Dalan | last post by:
Trying to determine the best approach to use in consolating multiple records in an Access 97 Db. The users submit updates in HTML format generated from a query that are in turn imported into a...
14
2009
by: --CELKO-- | last post by:
Can I get a little help? Given a very simple table of events, with their durations, I want to consolidate time periods for an event that (1) touch each other or (2) overlap each other. CREATE...
3
2440
by: AccessHunter | last post by:
CASE_ID BEFORE BETWEEN AFTER 53222 N N Y 53222 Y N N 53222 Y N N 53222 Y N N 53222 Y N N 53222 Y N ...
0
7194
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
7070
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
7316
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...
1
6976
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...
0
7449
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5566
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3160
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
729
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
372
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.