This SQL method takes two arguments "types" and "orderby". In the calling form I allow the arguments to be initialized with "" to indicate no selection. SELECT * FROM Technologies <!--#if types--> WHERE type IN (<!--#var types-->) <<<< Work in progress, (one value) <!--#/if--> <!--#if orderby--> ORDER BY <!--#sqlvar orderby type=int-->, 1 <!--#else--> ORDER BY 1 <!--#/if--> Larry