Solved

Passing Parameters to Seagate Crystal Reports

Posted on 2003-10-31
7
232 Views
Last Modified: 2010-05-03
I am using a Visual Basic Application as the Front End and Crytsal Reports as the Reporting tool.  I want to generate some reports on the base of the dates provided by the user, for that I have to pass the "from date" and the "to date" to the Crystal Reports as parameters.  But every time I pass the SQL query to the crystal reports alongwith the parameters it always gives me an error and never the correct report with the data is generated.  So can u tell me how can I pass the SQL query alongwith the dates as the parameters to the Crystal Reports.  I am using VB 6.0 and Crystal Reports 8.0
0
Comment
Question by:njvyas007
  • 2
7 Comments
 

Expert Comment

by:nirmal_4194
Comment Utility
do not declare your parameter as date, declare parameter as text and then in your query - WHERE clause you convert the text into date using CDate() function.

i.e.
PARAMETERS mFromDt Text(125), mTODt Text(125);
SELECT * FROM tbl_Master WHERE FromDate >= cdate(mFromDt) AND ToDate <= cdate(mToDt)

pass your parmater as text in vb.

i hope this will solve your problem.
0
 
LVL 100

Accepted Solution

by:
mlmcc earned 20 total points
Comment Utility
0
 
LVL 75

Expert Comment

by:Anthony Perkins
Comment Utility
0
 
LVL 100

Expert Comment

by:mlmcc
Comment Utility
My link should have solved the problem.

mlmcc
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now