Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Pass variable to Oracle Query form Crystal Reports

Posted on 2003-12-11
2
Medium Priority
?
527 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 3

Accepted Solution

by:
AnnetteHarper earned 200 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
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…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

715 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