ktrinad Posted September 5, 2006 Share Posted September 5, 2006 By: emredincer - emredincer help with DATE fields 2006-06-16 01:12I have two date fields in mysql(START_DATE,END_DATE) and i need to create a report where i will display records between a given startDate and endDate.I define input controls for these two dates of type date however jasperserver does not accept date formats as mysql the db holds...(YYYY-MM-DD) I can not use texts since i need comparison like(>=startDate AND <=endDate) any suggestions.. best regards emre dincer By: Javy Dreamer - javydreamercsw RE: help with DATE fields 2006-06-16 10:20I see no problem at all. A condition like this one: DATE_TO_BE_COMPARED between DATE($P{START_DATE}) AND DATE($P{END_DATE}) For more details: http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html Link to comment Share on other sites More sharing options...
JamieDenman Posted December 4, 2007 Share Posted December 4, 2007 MySQL does not seem to accept DATE($P{date_as_string}) of any variations of that. I'm having the same problems as loads of others on this site: use JasperServer calendar to select a date and report falls over with SQL error or doesn't find any data due to date format being incorrect in very simple MySQL query. iReports can format a date (even as a string) in a text field but this doesn't work when writing the SQL as there is no access to a "pattern". Have tried the MySQL formatting methods and iReports doesn't seem to like them!!!! Why have the developers made a basic element like date handling so complex that there are hundreds of posts (most without any solutions that work) on this site asking about it? Link to comment Share on other sites More sharing options...
lucianc Posted December 5, 2007 Share Posted December 5, 2007 JamieDenman wrote:I'm having the same problems as loads of others on this site: use JasperServer calendar to select a date and report falls over with SQL error or doesn't find any data due to date format being incorrect in very simple MySQL query. Which JasperServer version are you using? Does the report data source specify a timezone? Regards,Lucian 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