Solved

Parameter for a Database COMMAND?

Posted on 2006-06-30
2
268 Views
Last Modified: 2012-06-21
I'm using this SQL Command at the Database Command line level and I would like to have the ability in CR XI to input/change the DATE within the Crystal Report...instead of having to go to the Command Line here and change it. I "think" I need to use a parameter but not sure how.

How can I have the DATE of 06-30-2006 00:00:00 changed to where I use the SELECT CRITERIA in Crystal to change the date for the report run...THANKS
Mike



declare @HistDate datetime
set @HistDate = '06-30-2006 00:00:00'  --<<<--- Type in the Historical Unit DATE that you wish to use HERE
SELECT *
FROM (
select ( dbo.gethistoricalunit(dbo.bkcyacct.[file number],@HistDate)) as [HistUnit],*
from dbo.bkcyacct
where [system closed date] is null
or [system closed date] > @HistDate
and [file open date] <= @HistDate
 )A

WHERE A.[HistUnit] is  not null
--and [file number] not like 'Z%'
and [file number] not like '99%'
and [file number] not like '1001%'

0
Comment
Question by:MIKE
2 Comments
 
LVL 42

Accepted Solution

by:
frodoman earned 500 total points
ID: 17019473
declare @HistDate datetime                  --<<<--- don't need
set @HistDate = '06-30-2006 00:00:00'  --<<<--- don't need

SELECT *
FROM (
select ( dbo.gethistoricalunit(dbo.bkcyacct.[file number],{?HistDate})) as [HistUnit],*
from dbo.bkcyacct
where [system closed date] is null
or [system closed date] > {?HistDate}
and [file open date] <= {?HistDate}
 )A


In the above, "HistDate" is your date parameter in Crystal.  Format your SQL as shown above to compare to the date parameter.
0
 
LVL 17

Author Comment

by:MIKE
ID: 17019480
Got it working...THANKS
M
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
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…

791 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