Solved

Parameter for a Database COMMAND?

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

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Mask on Parameter CR2008 28 83
can i install CR2016 alongside CR2008 without overwriting it? 4 63
Sum Before Standard Deviation 2 38
How Parameters Work 2 33
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…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

752 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