multiple values in a prompt
Following is my WHERE clause. This works great when there is only 1 account. where stn_ops_hierarchies.department = journal_entries.department AND ((group_id = :My_Group AND region_cd = :My_Region and region_cd IS NOT NULL) OR (group_id = :My_Group AND :My_Region IS NULL)) AND (accounting_date >= :Date_From and accounting_date <= :Date_To AND account_gl = :My_Account) I need to change this to allow for multiple accounts but I'm not sure how to write the sql code that will process multiple accounts. In the new version of the report, My_Account will contain 1, 2, 3 or more accounts. I'm assuming I would need something like an "In List" but I don't know how to do this with SQL. Thanks for the help...
August 16th, 2011 4:44pm

Try changing the last line of the WHERE clause to AND account_gl IN (:My_Account))
Free Windows Admin Tool Kit Click here and download it now
August 16th, 2011 5:06pm

See also http://social.msdn.microsoft.com/Forums/en-US/transactsql/thread/9fe81bb2-1807-4caf-8fbb-bedf8817f732/#16f34d21-7792-47a3-a6b9-eba963f0b726For every expert, there is an equal and opposite expert. - Becker's Law My blog
August 16th, 2011 5:21pm

Thank you.....that did the trick
Free Windows Admin Tool Kit Click here and download it now
August 16th, 2011 5:24pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics