Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to format this data into tabular/pivot format

Status
Not open for further replies.

RaffiqEddy

Programmer
Jan 7, 2002
51
0
0
MY
Hello Expert!

I need help to I translate this data...

Table "LeaveDetail"

Code:
StaffNo | StartDate  | EndDate    | LeaveType |
1       | 23/04/2006 | 26/04/2006 | AL        |
2       | 24/04/2006 | 25/04/2006 | MC        |
3       | 26/04/2006 | 27/04/2006 | EL        |
1       | 30/04/2006 | 02/05/2006 | EL        |
Into this format...

Code:
        |Apr|Apr|Apr|Apr|Apr|Apr|Apr|Apr|May|May|May|May|
StaffNo |23 |24 |25 |26 |27 |28 |29 |30 |01 |02 |03 |04..
---------------------------------------------------------
  1     |AL |AL |AL |AL |   |  ...  |EL |EL |EL |
  2     |   |MC |MC |   |   |
  3     |   |   |   |EL |EL |

Parameter:
Date From '23/04/2006' to '23/05/2006'

Using only query statement...

Is this possible??

TIA

Regards.
 
Look up "CrossTab" in Books on Line.

It should give you what you want.


Rob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top