I have inherited an information system where the table structure does not help reporting. I have a select query which returns the following data structure
Name DataItem AnswerYN AnswerDate
Bloggs 1 True
Bloggs 2
Bloggs 3 01/01/07
Bloggs 4
Bloggs 5
Bloggs 6 True
Bloggs 7
Bloggs 8 01/02/07
This means:
Data item 1 would be question 1 with an answer of Yes.
Data Item 2 would be question 1 with an answer of No.
Data Item 3 would be question 2 with an answer of 01/01/07.
Data Item 4 would be question 3 with an answer of ward 1.
Data Item 5 would be question 3 with an answer of ward 2.
Data Item 6 would be question 3 with an answer of ward 3.
Data Item 7 would be question 3 with an answer of ward 4.
Data item 8 would be question 4 with an answer of 01/02/07.
The logic is that only one of Item 1 and Item 2 can be True and that there will never be a date in Item 1 and Item 2's record and that item 3 will never have a True/False but only a date etc)
What I want to be able to show is this (using the data from above)
Name Question1 Question2 Question3 Question4
Bloggs Yes 01/01/07 Ward 3 01/02/07
Can anybody help me out? Can this be done through queries? Or should I create a table and build up the data by doing lots of appends and updates?
Thanks in Advance
Jonathan
Name DataItem AnswerYN AnswerDate
Bloggs 1 True
Bloggs 2
Bloggs 3 01/01/07
Bloggs 4
Bloggs 5
Bloggs 6 True
Bloggs 7
Bloggs 8 01/02/07
This means:
Data item 1 would be question 1 with an answer of Yes.
Data Item 2 would be question 1 with an answer of No.
Data Item 3 would be question 2 with an answer of 01/01/07.
Data Item 4 would be question 3 with an answer of ward 1.
Data Item 5 would be question 3 with an answer of ward 2.
Data Item 6 would be question 3 with an answer of ward 3.
Data Item 7 would be question 3 with an answer of ward 4.
Data item 8 would be question 4 with an answer of 01/02/07.
The logic is that only one of Item 1 and Item 2 can be True and that there will never be a date in Item 1 and Item 2's record and that item 3 will never have a True/False but only a date etc)
What I want to be able to show is this (using the data from above)
Name Question1 Question2 Question3 Question4
Bloggs Yes 01/01/07 Ward 3 01/02/07
Can anybody help me out? Can this be done through queries? Or should I create a table and build up the data by doing lots of appends and updates?
Thanks in Advance
Jonathan