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

x
?
Solved

Parameter for a Database COMMAND?

Posted on 2006-06-30
2
Medium Priority
?
276 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 2000 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: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
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 …
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

730 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