R
Rajesh B. Patel
hello,
I see many posts on this topic, but still am not sure on the simplest proper
solution.
I have a table
ID DOB
1 9/1/77
2 11/30/77
3 6/23/77
and another table
ID ExamNumber Date
1 1 11/1/90
1 2 1/1/97
1 3 2/1/96
2 1 3/1/94
2 2 4/1/89
2 3 5/1/84
3 1 6/1/85
3 2 7/1/95
3 3 8/1/95
I want a sql query that will produce
ID DOB Date 1 Date 2 Date 3
1 9/1/77 11/1/90 1/1/97 2/1/96
2 11/30/77 ....
How can I do this with straight sql? I have a crosstab as follows that seems
to work as follows -
TRANSFORM First(qryTest.Date) AS FirstOfDate SELECT qryTest.ParticipantID,
qryTest.DOB, First(qryTest.Date) AS [Total Of Date] FROM qryTest GROUP BY
qryTest.ParticipantID, qryTest.DOB PIVOT qryTest.ExamNumber;
Is this guaranteed to give me the results I desire. The part I question is
First(qryTest.Date) since I just want to display all the Date for a
particular ID/DOB combo...
Thanks in advance
raj
I see many posts on this topic, but still am not sure on the simplest proper
solution.
I have a table
ID DOB
1 9/1/77
2 11/30/77
3 6/23/77
and another table
ID ExamNumber Date
1 1 11/1/90
1 2 1/1/97
1 3 2/1/96
2 1 3/1/94
2 2 4/1/89
2 3 5/1/84
3 1 6/1/85
3 2 7/1/95
3 3 8/1/95
I want a sql query that will produce
ID DOB Date 1 Date 2 Date 3
1 9/1/77 11/1/90 1/1/97 2/1/96
2 11/30/77 ....
How can I do this with straight sql? I have a crosstab as follows that seems
to work as follows -
TRANSFORM First(qryTest.Date) AS FirstOfDate SELECT qryTest.ParticipantID,
qryTest.DOB, First(qryTest.Date) AS [Total Of Date] FROM qryTest GROUP BY
qryTest.ParticipantID, qryTest.DOB PIVOT qryTest.ExamNumber;
Is this guaranteed to give me the results I desire. The part I question is
First(qryTest.Date) since I just want to display all the Date for a
particular ID/DOB combo...
Thanks in advance
raj