Solved

Parameter for a Database COMMAND?

Posted on 2006-06-30
2
259 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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…
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

747 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

12 Experts available now in Live!

Get 1:1 Help Now