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!

ODBC error while calling a sub report

Status
Not open for further replies.

mpsudheer

Programmer
Sep 22, 2003
4
IN
hi there,

I have a main reprt which contains details of users like First name, last name ,address etc. This i am selecting directly from a table (database is SQL Server) . I have a sub report which should display the transaction details done by the user in between FromDate and ToDate. For this subreport i have written a parametrised query which accepts the From and To dates and selects details of all the users and transactions in that period. I have linked the main report and sub report on Firstname and lastname fields. In the query i am casting the date to smalldatetime. When i run the report it is giving ODBC error.. saying error in converting string to datetime.. .

can any body please help me .

Thanks
Sudheer
 
It sounds like your syntax is wrong...

I've not used parameterized queries within a Crystal Report (didn't know that you could directly), though I've used plenty of Stored Procedures.

Try converting it to an SP, and make sure that you use the right connectivity type (CR supplied).

-k
 
hi,

Yes u can have parametrized queries. instead of value u can give , for example:- {?From date}. So when u run (preview )the report it will ask for the date. I have tried the query in a main report. Then it is working fine. Only when the same query is used in subreport and the sub report when called from main, it is giving the error.... Please suggest a remedy..

Thanks
Sudheer
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top