Solved

Pass variable to Oracle Query form Crystal Reports

Posted on 2003-12-11
2
512 Views
Last Modified: 2006-11-17
I want to pass a date variable to a sql statement from Crystal
Reports to limit the scope of the report.  The part of the query
accepting the variables looks like:

"Calendar_Date between To_Date('2003/01/01','yyyy/mm/dd') and
To_Date('2003/01/28','yyyy/mm/dd')"

And I'd be wanting to replace the date part of the query with a
user-entered date.  As I'm new to Oracle and Crystal, I don't know
where to start.  Is there a way to replace the '1-JUN-03' part with a
variable in Oracle, then modify that variable when I'm designing the
report?

Grabbing all the results and then filtering them in Crystal won't work
as this table is very large.  Apologies in advance if this question
has been asked a million times.
0
Comment
Question by:wayne_baswell
2 Comments
 
LVL 3

Accepted Solution

by:
AnnetteHarper earned 50 total points
ID: 9920620
Just create two date parameter fields, Start_Date and End_Date, and put them in your selection formula like this.

Calendar_Date between {?Start_Date} and {?End_Date}

Assuming there aren't any other complications, Crystal will convert the date parameters to date literals with the proper TO_DATE function when it creates the query to send to Oracle. You can check this by looking at the menu Database | Show SQL Query.

Crystal will not, however, create Oracle bind variables for you. If you need that, you'll have to use a stored procedure. (You'd need that only if you are concerned about the amount of parsing going on.)
0
 
LVL 1

Author Comment

by:wayne_baswell
ID: 9920696
Thanks, I'm new at Oracle/Crystal and that's what I needed to know.
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Crystal Reports remove alpha characters only 5 56
Use data from .txt file into Crystal reports 9 64
Crystal Report detail 15 51
Crystal Report sorting 6 16
Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

820 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