Turning the records in a table sideways (1 Viewer)

BukHix

Registered User.
Local time
Today, 02:27
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?
 

boblarson

Smeghead
Local time
Yesterday, 23:27
Joined
Jan 12, 2001
Messages
32,059
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?
 

BukHix

Registered User.
Local time
Today, 02:27
Joined
Feb 21, 2002
Messages
379
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.
 

WayneRyan

AWF VIP
Local time
Today, 07:27
Joined
Nov 19, 2002
Messages
7,122
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
 

BukHix

Registered User.
Local time
Today, 02:27
Joined
Feb 21, 2002
Messages
379
That worked great. Thank you very much for the help!
 

WayneRyan

AWF VIP
Local time
Today, 07:27
Joined
Nov 19, 2002
Messages
7,122
Buk,

Glad to help.

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

Been there,
Wayne
 

Users who are viewing this thread

Top Bottom