[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

RE: [sqr-users] On-breaks Problem - I think



This is a reason dynamic variables were created.  Any part of your SQL
statement can be replaced with a dynamic variable that you can set within
the program.  The dynamic variable should appear within your SQL in the form
[$variable].  Example:

let $zip = '12345'
let $zipcode = 'and C.ZIPCODE = $zip'
begin-select
...
from CUSTOMER C
where C.STATE = 'MA'
[$zipcode]
end-select

Notice that the text of $zipcode becomes part of a SQL statement and the SQL
statement contains a condition that compares the value of a column
(C.ZIPCODE) to the value of a variable ($zip).  SQR will send a SQL
statement to the database manager in the form:

select ... from CUSTOMER C where C.STATE = 'MA' and C.ZIPCODE = :1


SQR will also send '12345' as the value of bind variable :1.

-----Original Message-----
From: Miller, Danika [mailto:MillerD2@ndu.edu]
Sent: Friday, June 18, 2004 1:14 PM
To: 'sqr-users@sqrug.org'
Subject: [sqr-users] On-breaks Problem - I think


My run control page asks if the report should be run by either A, B, C, D,
or E.  A&B share the same select statement (diff. where clause), and C, D, &
E share the same select statement (diff. where clause).

 

And there's a radio button asking how the report should be grouped: either
by country or start date.

 

There are many possible variances in running this report:  

                        A - Group by country

                        A - Group by start date

                        B - Group by country

                        B - Group by start date

                        C, D, E - etc.

 

Would I have to have a different select statement for each and every
possible combination? 

For example, 

if A and country             do select 1  with an on-break on country

if A and start date          do select 2  with an on-break on start date

if B and country             do select 3  with an on-break on country

if B and start date          do select 4  with an on-break on start date

 

 

Any ideas??????????

 

 

_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users

_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users