Log in

View Full Version : Query regarding converting column to row in MS Access


sonalthakker
Feb 27, 2007, 07:02 AM
Hello,

I have table in MS Access as bellow
Name Date Time In_Out
X 25/1/07 09:00 AM IN
X 25/1/07 12:00 PM Out
X 25/1/07 01:00 PM IN
X 25/1/07 07:00 PM Out
Y 25/1/07 12:00 PM IN
Y 25/1/07 06:00 PM Out
.

I want to convert it as bellow


Name Date T In T Out T In T Out
X 25/1/07 09:00 AM 12:00 PM 01:00 PM 07:00 PM
Y 25/1/07 12:00 PM 06:00 PM


Can any one help me?

Thanks in advance

Sonal

ScottGem
Feb 27, 2007, 07:10 AM
Your data is in a normalized setup. So you don't want to convert the actual data. Are you just trying to create a report or what?

sonalthakker
Feb 27, 2007, 07:31 AM
Yes ScottGem your are right. I am trying to generate report.

Thanks a lot

ScottGem
Feb 27, 2007, 07:35 AM
I would suggest that you would be better off using grouping then to try setting up the columns like you wanted. If you group on Employee then date, You will have an easy to read report of time in and out.

If you really feel you need the columna format, try using a cross tab query. Set the times as the columns and Employee and Date as the Rows.