Skip to Content
0
Former Member
Oct 30, 2009 at 07:20 AM

One query for several fields

45 Views

Hi guys,

This is my first post.Hope i can explain my problem to you all can understand.

I have 16 udfs and 16 queries which i bind it one to one. But all 16 queries, they have almost the same query structure so when i change the query structure i have to edit all 16 queries one by one , it's so annoying. So i hope that it has any way to just combine all 16 queries into one and specified which field i want to put the result of each part of the query to go to instead. For example

query1 : select sum(doctotal) from inv1 inner join oinv on inv1.docentry = oinv.docentry where inv1.acctcode between (100000 and 199999)

query2 : select sum(doctotal) from inv1 inner join oinv on inv1.docentry = oinv.docentry where inv1.acctcode between (200000 and 299999)

and query1 I bind it to udf1,query2 bind to udf2

instead i want :

query 0 :

select sum(doctotal) from inv1 inner join oinv on inv1.docentry = oinv.docentry where inv1.acctcode between (100000 and 199999)

select sum(doctotal) from inv1 inner join oinv on inv1.docentry = oinv.docentry where inv1.acctcode between (200000 and 299999)

and bind query 0 to udf0 and when i click the 'magnifying glass' icon in udf0 i want the result of first select go into udf1 and the result of the second select go into udf2

is it possible?

thanks in advance.