TheMatthew Posted September 8, 2016 Share Posted September 8, 2016 I have an input control that will need to be populated by a query. When I wrote the code in My SQL Server, it works perfectly as planned. However, when I put it in the the input control, the drop down is blank. Are cases not allowed in the input control queries? Is there a work around? here is the seemingly simple sql code: SELECT a.PRSTART as date, case when(a.prstart <= getdate() - 7 and a.prfinish - 1 >= getdate() - 7) then 'Previous Period' when (a.prstart <= getdate() + 7 and a.prfinish - 1 >= getdate() + 7) then 'Next Period' else 'Current Period' end as period FROM PRTIMEPERIOD a WHERE (a.prstart <= getdate() and a.prfinish - 1 >= getdate()) or (a.prstart <= getdate() - 7 and a.prfinish - 1 >= getdate() - 7) or (a.prstart <= getdate() + 7 and a.prfinish - 1 >= getdate() + 7)[/code] as you can see, I need to return "Previous", "next", or "current time period" dynamically along with the date calculated. for the input control, previous, next, and current would be the visible field, while the date would be used as the value column. thanks! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now