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

Passing Query from VB

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
How can I dynamically pass the Query for sql report from the VB( Ex- select * from Employee_details where date1="")

Now I want to pass the date from the Front-End .

How can I do that

Thanks
Anil
 
1. You can use ActiveData as your data source for the report, in which case you can pass a recordset to Crystal, e.g.:
Code:
rs.Open "SELECT * FROM MyTable"
rpt.SetdataSource rs, 3, 1

2. You can specify a record selection formula and filter the table for a specific date, e.g.:
Code:
rpt.RecordSelectionFormula = "{Data.MyDate}=" & Chr$(34) & strMyDate & Chr$(34)
(Chr$(34) is the double-quote character).

3. You can set up a parameterized stored procedure and pass it a parameter, e.g.:
Code:
rpt.ParameterFields(1).AddCurrentValue CDate(strMyDate)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top