1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
|
Public Sub REPONSE(ByVal noetude As String, strsql As String)
Dim strtable As String
Dim strcriteria As String
strtable = "CARACATT, ETUDES, QUESTIONS, MODALITES"
strcriteria = "CARACATT.no_etude in (" & noetude & ")"
strcriteria = strcriteria & " And CARACATT.no_etude=ETUDES.no_etude And CARACATT.reponse=MODALITES.modalite AND CARACATT.question=MODALITES.question and ETUDES.no_etude=MODALITES.no_etude and QUESTIONS.question=MODALITES.question and QUESTIONS.no_etude=MODALITES.no_etude"
strcriteria = strcriteria & " And (CARACATT.question)='INTENTION DE RECONSOMMATION'"
strsql = "SELECT ETUDES.type_produit, CARACATT.no_produit, CARACATT.question, CARACATT.reponse, IIf([modalite_max]=5 And ([reponse]='1' Or [reponse]='2'),'1',IIf([modalite_max]=5 And ([reponse]='4' Or [reponse]='5'),'2',IIf([modalite_max]=4 And ([reponse]='1' Or [reponse]='2'),'1',IIf([modalite_max]=4 And ([reponse]='3' Or [reponse]='4'),'2',IIf(([modalite_max]=2 Or [modalite_max]=3) And [codage]=NON And [reponse]='2','2',IIf(([modalite_max]=2 Or [modalite_max]=3) And [codage]='NON' And [reponse]='1','1',IIf(([modalite_max]=2 Or [modalite_max]=3) And [codage]='OUI' And [reponse]='2','2',IIf(([modalite_max]=2 Or [modalite_max]=3) And [codage]='OUI' And [reponse]='1','1',IIf(([modalite_max]=3 Or [modalite_max]=5) And ([codage]='JE NE SAIS PAS' Or [codage]='JE NE SAIS SI JE L'ACHETERAIS OU NON') And [reponse]='3','3'))))))))) AS REPONSE_CARACATT, QUESTIONS.modalite_max, MODALITES.codage INTO REPONSE"
strsql = strsql + " FROM " & strtable
strsql = strsql + " WHERE ((" & strcriteria & "))"
strsql = strsql & " GROUP BY ETUDES.type_produit, CARACATT.no_produit, CARACATT.question, CARACATT.reponse, QUESTIONS.modalite_max, MODALITES.codage;"
End Sub |
Partager