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

Using Parameters in SQL Commands 1

Status
Not open for further replies.

racskelly

IS-IT--Management
Apr 19, 2007
37
CA
I'd like to know if it is possible to use Crystal Parameters in a SQL Command... for example...

I want the user setup a complex SQL statement

SELECT * FROM APPROVED_TRADES
WHERE trade_dt in {?Start Date} to {?End Date}

UNION

SELECT * FROM VOID_TRADES
WHERE trade_dt < {?Start Date} and
void_dt in {?Start Date} to {?End Date}

is that possible?
 
Yes. Create the parameters within the command.

I'm not sure whether the fields would be returned in the order necessary for the union to work, but you could always specify the fields to ensure you met the criteria necessary for a union (same number of fields, fields in the same order, of the same corresponding datatype, etc.).

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top