strSQL = "SELECT PIN, Form, Status_Flag " +
" ,CASE Status_Flag WHEN 'A' THEN 1 ELSE 0 END [A_Flag] " +
" ,CASE Status_Flag WHEN 'Q' THEN 1 ELSE 0 END [Q_Flag] " +
" ,CASE Status_Flag WHEN 'W' THEN 1 ELSE 0 END [W_Flag] " +
" ,CASE Status_Flag WHEN 'O' THEN 1 ELSE 0 END [O_Flag] " +
" ,CASE Status_Flag WHEN 'D' THEN 1 ELSE 0 END [D_Flag] " +
" ,CASE Status_Flag WHEN 'Z' THEN 1 ELSE 0 END [Z_Flag] " +
" ,CASE Status_Flag WHEN 'X' THEN 1 ELSE 0 END [X_Flag] " +
" ,CASE Status_Flag WHEN 'U' THEN 1 ELSE 0 END [U_Flag] " +
" FROM t_Answer GROUP BY RecNum, Form, PIN, Status_Flag " +
" ,CASE Status_Flag WHEN 'A' THEN 1 ELSE 0 END " +
" ,CASE Status_Flag WHEN 'Q' THEN 1 ELSE 0 END " +
" ,CASE Status_Flag WHEN 'W' THEN 1 ELSE 0 END " +
" ,CASE Status_Flag WHEN 'O' THEN 1 ELSE 0 END " +
" ,CASE Status_Flag WHEN 'D' THEN 1 ELSE 0 END " +
" ,CASE Status_Flag WHEN 'Z' THEN 1 ELSE 0 END " +
" ,CASE Status_Flag WHEN 'X' THEN 1 ELSE 0 END " +
" ,CASE Status_Flag WHEN 'U' THEN 1 ELSE 0 END " +
" ";
|