Jump to content
JasperReports Library 7.0 is now available ×

Query for input control wont work in Jaspersoft, but works in My SQL Server


TheMatthew

Recommended Posts

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

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Popular Days

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...