Turning the records in a table sideways

BukHix

Registered User.
Local time
Today, 16:14
Joined
Feb 21, 2002
Messages
379
I have a table with data structured like this:
Code:
Emp#	ST	OT
--------------------
30174	1421	540
30180	1882	518
30200	2400	0
30223	2271	66
I want to create a query that takes that data and does this:

Code:
Emp#	ST	OT
--------------------
30174	1421	0
30174	0	540
30180	1882	0
30180	0	518
30200	2400	0
30200	0	0
30223	2271	0
30223	0	66
Is that even possible? How do I get started?
 
Out of curiosity, I'm wondering what you are trying to actually accomplish. Can you elaborate further as to why you want it to look like that?
 
I am creating an export for a third party Payroll Company who needs regular and overtime on separate lines with a notation of which is which.

The notation should be pretty easy using an ImmediateIf Checking for a greater the 0 in either column but I am not sure how to get the data in the format I need it.
 
Buk,

To get the proper number of rows, you'll need a Union query.

Select EmployeeNumber, ST, 0 As OT From YourTable UNION
Select EmployeeNumber, 0 As ST, OT From YourTable

Wayne
 
That worked great. Thank you very much for the help!
 
Buk,

Glad to help.

Update your profile ... you're older than you think.

Been there,
Wayne
 

Users who are viewing this thread

Back
Top Bottom