Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CR9 - "Add command" want to use parameters from an ASP page.

Status
Not open for further replies.

Grouper1138

Programmer
May 27, 2005
7
US
I want to thank LB for helping me get this far!

Now my question is this...
How do I format the parameters in the SQL statement?
- Does the {?parament name} syntax work for that?
-----------------------------------------------------
Here's what I've got so far...

SELECT
GL00100.ACTNUMBR_1, GL00100. ACTNUMBR_2, GL00100.ACTNUMBR_3, GL00100.ACTNUMBR_4, GL00100.ACTDESCR, GL20000.JRNENTRY, GL20000.REFRENCE, GL20000.TRXDATE, GL20000.ORMSTRID, GL20000.ORMSTRNM, GL20000.CRDTAMT, GL20000.DEBITAMT
FROM GL00100
INNER JOIN GL20000
ON GL00100.ACTINDX = GL20000.ACTINDX
WHERE GL00100.ACTNUMBR_4 < "5999" AND
GL00100.ACTNUMBR_4 > "8100" and
{GL00100.ACTNUMBR_1} = {?Division} and
{GL00100.ACTNUMBR_2} = {?Location} and
{GL00100.ACTNUMBR_3} = {?Cost Center} and
GL20000.TRXDATE > {?Begin date} AND
GL20000.TRXDATE < {?Ending date}
UNION
SELECT
GL00100.ACTNUMBR_1, GL00100. ACTNUMBR_2, GL00100.ACTNUMBR_3, GL00100.ACTNUMBR_4, GL00100.ACTDESCR, GL30000.JRNENTRY, GL30000.REFRENCE, GL30000.TRXDATE, GL30000.ORMSTRID, GL30000.ORMSTRNM, GL30000.CRDTAMT, GL30000.DEBITAMT
FROM GL00100
INNER JOIN GL30000
ON GL00100.ACTINDX = GL30000.ACTINDX
WHERE GL00100.ACTNUMBR_4 < "5999" AND
GL00100.ACTNUMBR_4 > "8100" and
GL00100.ACTNUMBR_1 = {?Division} and
GL00100.ACTNUMBR_2 = {?Location} and
GL00100.ACTNUMBR_3 = {?Cost Center} and
GL30000.TRXDATE > {?Begin date} AND
GL30000.TRXDATE < {?Ending date}



-----------------------------------------------------

My other question is how to save the SQL query without specifying the parameters up front?
 
Did you resolve this? In CR 9, in the add command area, do you see a screen on the right where you can create parameters? If you create your parameters there, you should be able to place your cursor in the command where you want the parameter to appear and then double click on the newly created parameter. Alternatively, try placing each parameter in single quotes, as in: '{?Division}'

Let me know how you make out. I don't have CR 9, only 8 and 11, so I'm not sure about how this works in 9.0.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top