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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using parameter query in Crystal 8.5

Status
Not open for further replies.

namas

Technical User
Aug 31, 2006
31
US
Hi,
I got parameter query that runs ok in Crystal SQL Designer.
I am using this as datasource ('source.qry') in Crystal 8.5.
I expected it to ask for parameters 'year', 'Start Period' and 'End Period' when the report was run. However,
it doesn't ask for the parameters when report is run.
How can I make the user enter those parameters and pass
it to the query? Thanks.

SELECT IFS_gl_balance.gl_acct, IFS_gl_master.gl_abbrev_desc, (SELECT Sum(IFS_gl_balance1.gl_balance_amt)
FROM IFS_gl_balance as IFS_gl_balance1, IFS_fd_master as IFS_fd_master1
WHERE IFS_gl_balance1.gl_acct = IFS_gl_balance.gl_acct
AND IFS_gl_balance1.gl_year = {?year}
AND IFS_gl_balance1.gl_period < {?Start Period}
AND IFS_gl_balance1.gl_period >= {?End Period}
AND IFS_fd_master1.fd_id = IFS_gl_balance1.fd_id) AS GL_BEGBAL, (SELECT Sum(IFS_gl_balance2.gl_balance_debit)
FROM IFS_gl_balance as IFS_gl_balance2, IFS_fd_master as IFS_fd_master2
WHERE IFS_gl_balance2.gl_acct = IFS_gl_balance.gl_acct
AND IFS_gl_balance2.gl_year = {?year}
AND IFS_gl_balance2.gl_period <= {?End Period}
AND IFS_gl_balance2.gl_period >= {?End Period}
AND IFS_fd_master2.fd_id = IFS_gl_balance2.fd_id) AS GL_DEBITS, (SELECT Sum(IFS_gl_balance3.gl_balance_credit)
FROM IFS_gl_balance as IFS_gl_balance3, IFS_fd_master as IFS_fd_master3
WHERE IFS_gl_balance3.gl_acct = IFS_gl_balance.gl_acct
AND IFS_gl_balance3.gl_year = {?year}
AND IFS_gl_balance3.gl_period <= {?End Period}
AND IFS_gl_balance3.gl_period >= {?End Period}
AND IFS_fd_master3.fd_id = IFS_gl_balance3.fd_id) AS GL_CREDITS
FROM IFS_gl_master INNER JOIN (IFS_gl_balance
INNER JOIN IFS_fd_master ON IFS_gl_balance.fd_id = IFS_fd_master.fd_id)
ON (IFS_gl_master.gl_id = IFS_gl_balance.gl_acct)
AND (IFS_gl_master.fd_company = IFS_fd_master.fd_company)
WHERE (((IFS_gl_balance.gl_year)={?year})
AND ((IFS_gl_balance.gl_period)<={?End Period}))
GROUP BY IFS_gl_balance.gl_acct,
IFS_gl_master.gl_abbrev_desc
ORDER BY IFS_gl_balance.gl_acct, IFS_gl_master.gl_abbrev_desc;
 
Did you include the parameter in the select statement?
{Field} = {?parameter}

Thanks so much!
satinsilhouette
 
You can't use parameters in the where clause of the "Show SQL Query" area in CR 8.5, so I would be surprised if you could use it in a query used as a datasource for CR 8.5, but I might be wrong.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top