Link to home
Start Free TrialLog in
Avatar of Cuddalore
Cuddalore

asked on

Date parameter in select query of the CrysReport

Hi,
How do I use the Date parameter field in a report in the select query of the same  report.
ie,
I am calling the report from VB. Yes the parameter passes and I can get it in the report.

My SQL Query of the crystal report should look something like:
select <records> where accDate = <parameter field>

Thanks,
Ram
Avatar of DRRYAN3
DRRYAN3

Assuming your parameter is named dateparm, you refer to the entire parameter as {?dateparm} in formulas.

To pass the date to SQL, you may need to parse the parameter which is of date/time type to be of date type only using datevalue({?dateparm}).  Your version os SQL may also require that the date appear as a string, in which case your where clause would be

"...where accDate = '" + totext({?dateparm},"mm/dd/yyyy")

Avatar of Cuddalore

ASKER

Thanks Drryan3.
ASKER CERTIFIED SOLUTION
Avatar of DRRYAN3
DRRYAN3

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial