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

USE A FIELD AS A PARAMETER IN SQL QUERY ??? 1

Status
Not open for further replies.

TNN

Programmer
Sep 13, 2000
417
0
0
US
I have a paramaterized SQL query with one parameter. Can I use a field in details as the parameter for this query so that the results of the query would change as the field changes on the report??

Example for details section of report designer:

EmployeeNumber(field) Results of query using
EmployeeNumber as
parameter for query

I am a novice learning crystal reports 9.0, excuse please if I'm not to clear.

TNN, TOM
tnpayroll@truevine.net


TOM
 
Are you prompting the user for the employee number?

If you are, are you then wanting to pull back employee information on that employee based on what the user entered, yes or no?

-j
 
jodo,
No, we are not prompting the user for the employee number.
The employee number is a report field.
As the employee number field changes then the query will change.
Tom, TNN


TOM
 
Details are the result of a query, so the query would have to run prior.

Consider grouping on the EmployeeNumber, and using a subreport in the group header or footer to extract data other than that supplied by the main report.

If this doesn't correctly address your situation, please provide example data and expected output.

-k
 
when you save your query, uncheck save with data, then it can be work.
 
If the field is in a main report, and your query is run from a linked subreport sitting in the details section, you could link the parameter field to a field in the main report.

Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Expert's Guide to Formulas / Guide to Crystal in VB
- tek@kenhamady.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top