Thanks, but my problem relates to a date used in the SQL in my report query
I have a report that I need to run against a variety of SQL databases, i.e Oracle, MYSQL, DB2 I have tried using a value that is a java.util.date in my SQL query. Here is the relevant bit of my SL query : AND submitted_date >= $P!{PARAM_TO_DATE} parameter PARAM_TO_DATE is defined as a java.util.Date with the default Value Expression set to new java.util.Date("01/01/2050") But when the the Report query reads the SQL is gives the error Error : SQL problems: Missing IN or OUT parameter at index ::1 John Dunn Sefas Innovation Limited. Tel: + 44 (0) 117 373 6122 P Please consider the environment before printing this email -----Original Message----- From: David Bolen [mailto:db3l....@gmail.com] Sent: 13 November 2009 02:30 To: jasperreports-questions@lists.sourceforge.net Subject: Re: [jasperreports-questions] Default oracle date format in ireport "John Dunn" <jd...@sefas.com> writes: > Where?...I can't see anywhere to change it.... You can change the display format of a date field as one of the properties of that field in the report, or by manually formatting the field when constructing a string field. For simple date/time fields, use the Pattern property to select from one of the predefined patterns. You can also manually type in a pattern using the appropriate letter codes. For more elaborate formatting, you can make the field a String field, and then use String.Format with date/time formatting codes. For example, I have a title field defined as a string that uses: String.format('%tA, %<tB %<te', $F{class_date}) + ", " + String.format('%tl:%<tM %<tp', $F{start_time}) + " - " + String.format('%tl:%<tM %<tp', $F{end_time}) where class_date is a database date field, and start_time/end_time are database time fields. (Note that I think the above syntax may require a groovy Report interpreter, so if using Java you probably need some new() calls or something) which produces an output like: Monday, August 31, 9:30 am - 10:20 am I don't think the above should be database-specific. The JDBC interface to the database should be returning date/time fields in an appropriate java object, so once it's on the iReport side any of the formatting should be possible. -- David ------------------------------------------------------------------------ ------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ jasperreports-questions mailing list jasperreports-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jasperreports-questions ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ jasperreports-questions mailing list jasperreports-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jasperreports-questions