misuser2k7
MIS
I have a table in which records are identified by 4 different numbers. The table tabulates the results of marketing department’s focus group surveys.
The 4 different identifier numbers are the (1) Participant’s unique ID; (2) Survey type number; (3) Survey Case Number and (4) Survey Instance number.
These 4 numbers are required because the participants take different surveys but the results need to be saved in one table called ‘Survey_Results’.
Many participants start their survey but don’t complete them.
When a survey is opened, the system automatically assign the 4 numbers i.e. the Participant’s unique ID is derived from the login, Type number is assigned from opening the survey, Survey Case Number and Survey Instance number are assigned the value 0 (zero).
As the participants take different surveys of the same type number, the case and instance numbers are assigned to the attempts.
When participants start their survey but don’t complete them, they create dummy entries which take up several rows in the table.
I am trying to delete these “place holder” records where there is a Participant ID, Survey type number = x and Survey Case Number = 0 and Survey Instance number = 0.
Since all attempts are given a place holder record, I don’t want to delete the place holders for completed surveys.
Is there a way to build a delete query which would delete records where only the place holder records exist but not delete place holder records of completed surveys i.e. Survey Case Numbers > 0 and Survey Instance numbers > 0?
Thank you for your help.
The 4 different identifier numbers are the (1) Participant’s unique ID; (2) Survey type number; (3) Survey Case Number and (4) Survey Instance number.
These 4 numbers are required because the participants take different surveys but the results need to be saved in one table called ‘Survey_Results’.
Many participants start their survey but don’t complete them.
When a survey is opened, the system automatically assign the 4 numbers i.e. the Participant’s unique ID is derived from the login, Type number is assigned from opening the survey, Survey Case Number and Survey Instance number are assigned the value 0 (zero).
As the participants take different surveys of the same type number, the case and instance numbers are assigned to the attempts.
When participants start their survey but don’t complete them, they create dummy entries which take up several rows in the table.
I am trying to delete these “place holder” records where there is a Participant ID, Survey type number = x and Survey Case Number = 0 and Survey Instance number = 0.
Since all attempts are given a place holder record, I don’t want to delete the place holders for completed surveys.
Is there a way to build a delete query which would delete records where only the place holder records exist but not delete place holder records of completed surveys i.e. Survey Case Numbers > 0 and Survey Instance numbers > 0?
Thank you for your help.