D
Dave
I have the following query:
SELECT Trainee.IDENT, pcAssUnt.ACTDATE
FROM pcAssUnt INNER JOIN Trainee ON pcAssUnt.IDENT = Trainee.IDENT
WHERE (((pcAssUnt.QUALTYPE)="Q"))
ORDER BY Trainee.IDENT, pcAssUnt.ACTDATE;
and the output is:
IDENT ACTDATE
00001 27/04/2005
00001 29/06/2005
00003 09/06/2005
00003 23/06/2005
00005 13/05/2005
00005 23/05/2005
00005 10/06/2005
00005 24/06/2005
00006 22/06/2005
00007 23/05/2005
I would like to number the ACTDATEs by IDENT:
IDENT ACTDATE NUMBER
00001 27/04/2005 1
00001 29/06/2005 2
00003 09/06/2005 1
00003 23/06/2005 2
00005 13/05/2005 1
00005 23/05/2005 2
00005 10/06/2005 3
00005 24/06/2005 4
00006 22/06/2005 1
00007 23/05/2005 1
I would then like to crosstab the resultant query to display as:
IDENT ACTDATE01 ACTDATE02 ACTDATE03 ACTDATE 04 ACTDATE05
00001 27/04/2005 29/06/2005
00003 09/06/2005 23/06/2005
00005 13/05/2005 23/05/2005 10/06/2005 10/06/2005 24/06/2005
00006 22/06/2005
00007 23/05/2005
Can anyone suggest a way of achieving this 'numbering'.
The ACTDATE is not unique, as shown when removing the QUALTYPE criteria:
IDENT ACTDATE QUALTYPE
00001 27/04/2005 Q
00001 27/04/2005 U
00001 27/04/2005 U
00001 27/04/2005 U
00001 27/04/2005 U
00001 27/04/2005 U
00001 29/06/2005 Q
00003 09/06/2005 U
00003 09/06/2005 Q
00003 09/06/2005 U
00003 09/06/2005 U
00003 09/06/2005 U
00003 09/06/2005 U
00003 23/06/2005 Q
00003 23/06/2005 U
00003 23/06/2005 U
00003 23/06/2005 U
00003 23/06/2005 U...etc
any help is much appreciated
thanks
Dave
SELECT Trainee.IDENT, pcAssUnt.ACTDATE
FROM pcAssUnt INNER JOIN Trainee ON pcAssUnt.IDENT = Trainee.IDENT
WHERE (((pcAssUnt.QUALTYPE)="Q"))
ORDER BY Trainee.IDENT, pcAssUnt.ACTDATE;
and the output is:
IDENT ACTDATE
00001 27/04/2005
00001 29/06/2005
00003 09/06/2005
00003 23/06/2005
00005 13/05/2005
00005 23/05/2005
00005 10/06/2005
00005 24/06/2005
00006 22/06/2005
00007 23/05/2005
I would like to number the ACTDATEs by IDENT:
IDENT ACTDATE NUMBER
00001 27/04/2005 1
00001 29/06/2005 2
00003 09/06/2005 1
00003 23/06/2005 2
00005 13/05/2005 1
00005 23/05/2005 2
00005 10/06/2005 3
00005 24/06/2005 4
00006 22/06/2005 1
00007 23/05/2005 1
I would then like to crosstab the resultant query to display as:
IDENT ACTDATE01 ACTDATE02 ACTDATE03 ACTDATE 04 ACTDATE05
00001 27/04/2005 29/06/2005
00003 09/06/2005 23/06/2005
00005 13/05/2005 23/05/2005 10/06/2005 10/06/2005 24/06/2005
00006 22/06/2005
00007 23/05/2005
Can anyone suggest a way of achieving this 'numbering'.
The ACTDATE is not unique, as shown when removing the QUALTYPE criteria:
IDENT ACTDATE QUALTYPE
00001 27/04/2005 Q
00001 27/04/2005 U
00001 27/04/2005 U
00001 27/04/2005 U
00001 27/04/2005 U
00001 27/04/2005 U
00001 29/06/2005 Q
00003 09/06/2005 U
00003 09/06/2005 Q
00003 09/06/2005 U
00003 09/06/2005 U
00003 09/06/2005 U
00003 09/06/2005 U
00003 23/06/2005 Q
00003 23/06/2005 U
00003 23/06/2005 U
00003 23/06/2005 U
00003 23/06/2005 U...etc
any help is much appreciated
thanks
Dave