Possible Duplicate:
GROUP BY using parameters in SQL
Here is my SQL string for a OLEDB query of a .xlsx file
szSQL = "SELECT cawo_wo_id, wows_step_id, wows_description, wffj_cur_state_desc, cawo_wo_id & wows_step_id AS p5_id FROM [" & SourceSheet$ & "$" & sourceRange$ & "] WHERE [wows_description] like '%ECR%';"
I understand that named parameters are not supported by OLEDB, but why will it not work with a 'group by' using "?" as the parameter?
Like so:
szSQL = "SELECT cawo_wo_id, wows_step_id, wows_description, wffj_cur_state_desc, cawo_wo_id & wows_step_id AS p5_id FROM [" & SourceSheet$ & "$" & sourceRange$ & "] WHERE [wows_description] like '%ECR%' GROUP BY ?;"
Thanks for any help.