I am using Crystal Report 9.0 with my ASP.NET application. I have a crystal report that generates this query.
SELECT "job_headers"."cust_ptr", "job_headers"."invoice_number", "job_headers_acs"."datedue", "job_headers"."date_invoiced", "job_headers_acs"."amtOS", "sites_national"."s_add1", "global_customers"."add1", "global_customers"."add2", "global_customers"."add3", "global_customers"."town", "global_customers"."postcode", "global_customers"."company", "global_customers"."first_name", "global_customers"."surname", "job_headers"."arid_id", "job_headers_acs"."gcid_si", "credit_terms"."credit_terms_text", "job_headers"."jid", "global_customers"."customer_ref", "global_customers"."gcid", "job_headers_acs"."amtNet", "job_headers_acs"."amtVat", "sites_national"."s_add2", "sites_national"."s_add3", "sites_national"."s_town", "sites_national"."s_county", "sites_national"."s_postcode", "global_customers_cc"."gc_acc_status" FROM {oj (((("job_headers" "job_headers" INNER JOIN "job_headers_acs" "job_headers_acs" ON "job_headers"."jid"="job_headers_acs"."jid") INNER JOIN "sites_national" "sites_national" ON "job_headers"."site_ptr"="sites_national"."sid") INNER JOIN "global_customers" "global_customers" ON "job_headers_acs"."gcid_si"="global_customers"."gcid") INNER JOIN "credit_terms" "credit_terms" ON "global_customers"."credit_terms_ptr"="credit_terms"."id") LEFT OUTER JOIN "global_customers_cc" "global_customers_cc" ON "global_customers"."gcid"="global_customers_cc"."gc_acc_ptr"} WHERE "job_headers_acs"."amtOS"<>0 AND "job_headers"."date_invoiced"<{ts '2015-08-21 16:36:11'} AND ("global_customers_cc"."gc_acc_status" IS NULL OR "global_customers_cc"."gc_acc_status"<>0) AND "job_headers_acs"."gcid_si"=75850ORDER BY "job_headers_acs"."gcid_si", "job_headers"."cust_ptr", "job_headers"."date_invoiced"
Now in this query gcid_si is the input paramater that i passe from my ASP.NET application. If I don't put this and condition, it will print records of all the customers, in a one report. If I provide this customer ID, it will print records of just one customers,
whose ID I have passed in the input parameter.
Now I have to pass multiple customer IDs, in order to do that I have to changes the above and condition to this....
AND "job_headers_acs"."gcid_si" IN (75850,75851,75852,......................,78845)
Now it is not possible to pass multiple IDs separated by coma, How can I overcome this challange. The customers IDs are not in sequence, so I can't mentioned the range either. Can someone suggest me a solution to overcome this challange?