Solved

Passing Parameters to Seagate Crystal Reports

Posted on 2003-10-31
7
236 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
ID: 9662452
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
ID: 9662834
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 9663995
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 10170888
My link should have solved the problem.

mlmcc
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

911 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

22 Experts available now in Live!

Get 1:1 Help Now