SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Parameters appear only when selected from previous parameter


Parameters appear only when selected from previous parameter

Author
Message
wafw1971
wafw1971
SSC Journeyman
SSC Journeyman (78 reputation)SSC Journeyman (78 reputation)SSC Journeyman (78 reputation)SSC Journeyman (78 reputation)SSC Journeyman (78 reputation)SSC Journeyman (78 reputation)SSC Journeyman (78 reputation)SSC Journeyman (78 reputation)

Group: General Forum Members
Points: 78 Visits: 155
Below is my Dataset, what I would like to be able to do is only have a parameter showing if certain criteria is met can you help:

This is my process:

When the report is run the user is faced with one parameter, this is the Reporting Level Parameter this is not a multi value choice this a either/or option.

The choice is either/or ‘Company or BDM or Region or Site’

Once this is selected depending on choice the following parameters will unhide:

Company  Time  Date  Report Type

BDM  BDM Distinct List (This can be Multivalued)  Time (This can be Multivalued)  Date (This can be Multivalued)  Report Type (Either/Or)

Region  Region Distinct List (This can be Multivalued)  Time (This can be Multivalued)  Date (This can be Multivalued)  Report Type (Either/Or)

Site  Site Distinct List (This can be Multivalued)  Time (This can be Multivalued)  Date (This can be Multivalued)  Report Type (Either/Or)




SELECT OccupancyDetail.CalendarYear, OccupancyDetail.CalendarMonth, SUM(OccupancyDetail.No_of_Nights) AS No_of_Nights,
SUM(OccupancyDetail.Capacity) AS Capacity
FROM OccupancyDetail INNER JOIN
Site ON OccupancyDetail.Site_Skey = Site.Site_Skey

WHERE (OccupancyDetail.ReferenceDate = convert(Date,getdate()))

AND CASE WHEN @Time = 'YEAR' THEN CAST(CalendarYear as varchar(4))
else CalendarMonth + ' ' + CAST(CalendarYear as varchar(4)) end in (@Dates)

AND BDM IN (@BDM)
AND Region IN (@Region)
AND SiteName IN (@SiteName)


GROUP BY OccupancyDetail.ReferenceDate, OccupancyDetail.CalendarYear, OccupancyDetail.CalendarMonth

Thanks

Wayne
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search