faisal007 Posted August 15, 2007 Share Posted August 15, 2007 hi all , I want to execute a query with from to date paramter .but in jasper report ( Ireport ) i have no result .Please tell me what i do for this . Regards Faisal Link to comment Share on other sites More sharing options...
chill_work Posted August 15, 2007 Share Posted August 15, 2007 If I am following you correctly what you would do is this: where columnDate >= $P{someDate} and columnDate <= ${someDate} Of course this is for a range. If you are doing = and the date is a "dateTime" variable you will have to consider the time stamp with in that variable. Otherwise, you can substring it to test just the date. Calvin Link to comment Share on other sites More sharing options...
csbac Posted August 16, 2007 Share Posted August 16, 2007 Hi!Sorry, you missed a "P" there ...Code:where columnDate >= $P{someDate} and columnDate <= $P{someDate}alternatively (at least, most database systems suport this)Code:[code]where columnDate between $P{FromDate} and $P{ToDate} Then, you define FromDate and ToDate as parameters (view->parameters in ireport) of type java.util.Date, give them some sensible default values, e.g.,Code:[code]new java.util.Date()new java.util.Date(0)new java.util.Date(new java.util.Date()-1000l*3600*24) Hope this helps,Sebastian Link to comment Share on other sites More sharing options...
chill_work Posted August 16, 2007 Share Posted August 16, 2007 Well, Thanks for catching that. Calvin 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