Crystal Reports using SQL query

  • Follow


Hi gang,

Rather new to using CR, I have a SQL query I use inside of CR using the 
COMMAND inside of Database Expert. My SQL query includes:

***snip***
DECLARE @BegDate datetime;
DECLARE @EndDate datetime;
SET @BegDate = '20100701'
SET @EndDate = '20100731'
***end snip***

I would like to get rid of this hard-coded date portion in the SQL COMMAND 
and have the user running the report get a prompt for the data range they 
want. Also, I would like the selected date range to appear on final report. 
With this setup I cannot display the date range used in the report.

Any help is greatly appreciated...

-Pete
0
Reply Utf 10/11/2010 6:12:44 PM

You will need to pass @BegDate and @EndDate as parameters to the report, and 
add the parameters you have to your report for view, article below might 
help:
http://www.dotnetheaven.com/UploadFile/SaifiFFC/CrystalReport07122007062723AM/CrystalReport.aspx
-- 
Regards,
-- 
Mohammad R. Daoud [MVP, MCT]
MCP, MCBMSP, MCTS, MCBMSS
Mob: +962 - 79 -999 65 85
mohdaoud@gmail.com
http://mohdaoud.blogspot.com/

"ChicagoPete" <ChicagoPete@discussions.microsoft.com> wrote in message 
news:855E7DC8-0594-497E-A31F-A0330B8A25DF@microsoft.com...
> Hi gang,
>
> Rather new to using CR, I have a SQL query I use inside of CR using the
> COMMAND inside of Database Expert. My SQL query includes:
>
> ***snip***
> DECLARE @BegDate datetime;
> DECLARE @EndDate datetime;
> SET @BegDate = '20100701'
> SET @EndDate = '20100731'
> ***end snip***
>
> I would like to get rid of this hard-coded date portion in the SQL COMMAND
> and have the user running the report get a prompt for the data range they
> want. Also, I would like the selected date range to appear on final 
> report.
> With this setup I cannot display the date range used in the report.
>
> Any help is greatly appreciated...
>
> -Pete 

0
Reply Mohammad 10/11/2010 6:48:29 PM


1 Replies
1108 Views

(page loaded in 0.047 seconds)

Similiar Articles:
















7/23/2012 6:38:35 AM


Reply: