472,121 Members | 1,484 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,121 software developers and data experts.

Pass variable to Oracle Query form Crystal Reports

I want to pass a date variable to a sql statement from Crystal
Reports. The part of the query accepting the variables looks like:

"Calendar_Date between To_Date('1-JUN-03','mm/dd/yy') and
To_Date('30-JUN-03','mm/dd/yy')"

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.

--Wayne
Jul 19 '05 #1
4 9478
Wayne Baswell wrote:
I want to pass a date variable to a sql statement from Crystal
Reports. The part of the query accepting the variables looks like:

"Calendar_Date between To_Date('1-JUN-03','mm/dd/yy') and
To_Date('30-JUN-03','mm/dd/yy')"

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.

--Wayne


Your statement will not work - the date format differs too much from
the date offered - result will be an ORA-1860 (iirc)
'1-JUN-03','dd-mon-yy', or: '7/1/03','mm/dd/yy'
--
Regards, Frank van Bortel

Jul 19 '05 #2
You are correct. But I'm most concerned with finding a way to pass a
user entered variable to the query. Any ideas?

Thanks,

Wayne

Frank <fb*****@nescape.net> wrote in message news:<br**********@news2.tilbu1.nb.home.nl>...
Wayne Baswell wrote:
I want to pass a date variable to a sql statement from Crystal
Reports. The part of the query accepting the variables looks like:

"Calendar_Date between To_Date('1-JUN-03','mm/dd/yy') and
To_Date('30-JUN-03','mm/dd/yy')"

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.

--Wayne


Your statement will not work - the date format differs too much from
the date offered - result will be an ORA-1860 (iirc)
'1-JUN-03','dd-mon-yy', or: '7/1/03','mm/dd/yy'

Jul 19 '05 #3
"Wayne Baswell" wrote...
You are correct. But I'm most concerned with finding a way to pass a user entered variable to the query. Any ideas?

Thanks,

Wayne


Hi Wayne,

maybe a 'Crystal reports' group or forum could offer some help?

Sorry, no help,
Guido
Jul 19 '05 #4
I have found out that there is no way to bind a variable to the Select
statement from Crystal Reports. This has to be done with stored
procedures.

--Wayne
Jul 19 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

13 posts views Thread by kristoff plasun | last post: by
7 posts views Thread by vnl | last post: by
4 posts views Thread by Corrado Valiente | last post: by
2 posts views Thread by Bob Alston | last post: by
11 posts views Thread by =?Utf-8?B?cmtibmFpcg==?= | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.