Quantcast
Channel: SQL Server Reporting Services, Power View forum
Viewing all articles
Browse latest Browse all 10045

Date dataset/parameter/conversion/formatting Question

$
0
0

Hello,

I have the following datasets/query

Date :

SELECT        CONVERT(varchar(10), CAST(date AS DATE), 121) AS Dates
FROM            View.Date
WHERE        (date <= GETDATE())

StartDate:

SELECT        CONVERT(varchar(10), CAST(DATEADD(dd, - 1, GETDATE()) AS DATE), 121) AS StartDate

EndDate:

SELECT        CONVERT(varchar(10), CAST(GETDATE() AS DATE), 121) AS EndDate

OUTPUT = YYYY-MM-DD

StartDate and EndDate parameters are TEXT type and Available Values = Dates - Dates - Dates: and Default Values = StartDate - StartDate /EndDate - EndDate

Now I have a data-dataset that filters data based on these values.

Sample Query of the dataset

Select * From Table where (CONVERT(nVarChar(10), Period, 121) <= '2013-01-31') AND (CONVERT(nVarChar(10), Period, 121) >= '2012-12-31')

and data filters in SSMS.

I have instead wrote the following in SSRS query

Select * From Table where (CONVERT(nVarChar(10), Period, 121) >= @StartDate) AND (CONVERT(nVarChar(10), Period, 121) <= @EndDate)

BUT NO Data

I have mapped the parameters @StartDate :

@StartDate 

and @EndDate=

@EndDate

I have also tried the following values for parameters @StartDate :

="''+Parameters!StartDate.Value+"'"

& @EndDate : 

="''+Parameters!EndDate.Value+"'"

Yet no output.

Can anyone point out my mistake?

Thank you








Viewing all articles
Browse latest Browse all 10045

Trending Articles



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