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

How to pass variable from vb net to sql in report

Status
Not open for further replies.

gorfan

IS-IT--Management
Feb 13, 2004
9
I am quite new in using crystal reports.
My question is how can I pass data from a variable from vb net
to the database sql query in the report.

the query is like this:
SELECT ...... WHERE `stats`.`MoYe`='2004'
instead of 2004 I want to use my var.

I was able to pass the var as a parameter in the report but
not in the query.
 
You need to use the parameter and set up criteria in the Record Selection Formula in the report.
Use something like this per your example above:
Code:
{stats.MoYe} = {?YearParm}
This will pass the criteria along in the where clause of the SQL getting passed from Crystal to the database.

~Brian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top