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!

Inserting Selection Critera 2

Status
Not open for further replies.

Spirit

Technical User
Jul 12, 2002
1,150
GB
Feeling a bit dumb now!

But I am trying to get crystal to prompt for some sort of selection criteria like from Date X to Date Y or From Purchase Order number to Purchase Order number etc. and let the user select the range but I don't seem to be able to figure it out.

Thanks from a very rusty crystal report writer being thrust back into the world of report writing!

Ta,

Iain
 
Write a Parameter Field asking for a date, or date range. Then, create a Selection formula where the date field in your database relates to (=,<,> or <>) the user defined parameter. For example: {soPastInvcLn.InvcDate} = {?Invc Date}

Hope this helps.
 
Use the Insert->Field Object->Right click parameters->New

Define your parameters as range types.

Reference the parameters in the record selection formula (Report->Edit Selection Formula->Record), as in:

(
{table.datefield} = {?dateparm}
)
and
(
{table.POfield} = {?POparm}
)

The trick here is to optimize, so make sure that the SQL is passed to the server for everything referenced in the record selection formula, verify this using:

Database->Show SQL Query.

-k
 
Thanks guys,

Starting to get the hang of this again now!

Cheers,

Iain
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top