Quantcast
Channel: Crystal Reports
Viewing all articles
Browse latest Browse all 1507

Problem In Dynamic drop down Parameter-Dropdown is missing when Converting year and month to Date format

$
0
0
<div class="jive-rendered-content">

Hi,

I am using Two Dynamic drop down parameter and one static parameter for my report

Dynamic Parameter

     1.Year

     2.Location

Static parameter

     1.Month

 

When I am convert the year and month to date in the command section then the above two dynamic parameter drop down is missing and its displaying text box.

I have attached the Query below.Please let me know my mistakes.

I am using Crystal Report 2008 version 12.3.0.601

 

Please help me to get ride of this issue

 

 

Query

---------

 

DECLARE @YEAR as varchar(4)

Declare @MONTH as varchar(2)

Declare @Location as varchar(20)

declare @YrStDate as date

declare @MtStDate as date

declare @MtEndDate as date

 

 

set @MONTH ='{?Month}'

Set @YEAR ='{?Year}'

Set @Location='{?Location}'

 

 

declare @currentMonth as date

Declare @dt as date

select @dt= CONVERT(Date, ('1-' + @MONTH + '-' + @YEAR), 105)

set @currentMonth =  DATEADD(mm,DATEDIFF(mm,0,@dt),0)

set @YrStDate = DATEADD(yy,DATEDIFF(yy,0,@currentMonth),0)

set @MtStDate =  @currentMonth

set @MtEndDate = DATEADD(s,-1,DATEADD(mm, DATEDIFF(m,0,@MtStDate)+1,0))

BEGIN

    Select *  from Customer where TransDate between @currentMonth and @MtEndDate    and 1 = (CASE WHEN @Location <> '' AND LocationID = @Location THEN 1 WHEN @Location = '' THEN 1 END)

END

 

 

Thanks

Mathew

</div>

Viewing all articles
Browse latest Browse all 1507

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>