Jump to content
Changes to the Jaspersoft community edition download ×

How to link date parameters in query to retrieve the correct data


remyasr

Recommended Posts

i am using two date parameters $P{StartDate} AND $P{EndDate}  and having a query like 

SELECT DISTINCT

     expirydate.`ArticleName` AS expirydate_ArticleName,
     medicinelist.`Pos` AS medicinelist_Pos,
     medicinelist.`Quantity` AS medicinelist_Quantity,
     expirydate.`ExpirationDate` AS expirydate_ExpirationDate
FROM
     `expirydate` expirydate INNER JOIN `medicinelist` medicinelist ON expirydate.`Barcode` = medicinelist.`Barcode`
WHERE expirydate_ExpirationDate BETWEEN $P{start_date} AND $P{end_date}
order by medicinelist_Pos

it showing error
"Parameter type not supported in query : start_date class net.sf.jasperreports.types.date.DateRange".
 
How can i  fix the issue???
Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

  • 1 year later...

Hi,

 

You have used two parameters $P{StartDate} AND $P{EndDate} 

but in query you are using

WHERE expirydate_ExpirationDate BETWEEN $P{start_date} AND $P{end_date}
 
you have to use
WHERE expirydate_ExpirationDate BETWEEN $P{StartDate} AND $P{EndDate}
 
this will work.
 
Let me know if you face any problem
Link to comment
Share on other sites

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...