jamiedenman100 Posted March 30, 2010 Share Posted March 30, 2010 HiIs there a way to use the calendar pop-up for a data input but have the input type (class) set to java.lang.string?Our Oracle DB has nearly all it's "date" fields set as text, but I would like to be able to select a date from the calendar pop-up and pass parameter as type string to report (I use to_date in the report SQL). When I try to send java date and use to_char I get errors on type mismatch.Thanks in advance Link to comment Share on other sites More sharing options...
mdahlman Posted March 31, 2010 Share Posted March 31, 2010 First, I would like to commiserate with you. Using an Oracle database to store "dates" in varchar fields is a brutal abuse of the database. It will surely require ugly hacks like this in all of your applications. The database gods cannot be smiling.In principle you could update the JavaScript in the calendar control to produce text instead of dates. This is probably difficult... but it's surely possible.On the other hand, I don't see why there should be a problem with just using two parameters. MyDateParam would be a java.util.Date and MyStringParamHoldingADate would be a java.util.String. The default value of MyStringParamHoldingADate would be based on MyDateParam.On the other hand (the third hand, I guess) you mentioned using TO_DATE in the report SQL. Are you performing TO_DATE on MyVarcharFieldHoldingADate and performing TO_DATE on MyStringParamHoldingADate to compare them? I might cry. You should be fine with just using a standard Date parameter and then writing your SQL query with something like this:WHERE TO_DATE(MyVarcharFieldHoldingADate, 'yyyymmdd') < MyDateParam Regards,Matt Link to comment Share on other sites More sharing options...
jamiedenman100 Posted April 1, 2010 Author Share Posted April 1, 2010 Hi Matt, thanks for your replyyes, tell me about it!! It's due to this being a library management system and all the tables are created from MARC records so the dates are stored as text and in an alarming variety of formats!I'll try and use the holding var within JS first as I've run into problems using this on the VARCHAR fields (librarians do not seem to care where the month is nor how the year is entered it seems) I'll post an update with how this goes.Thanks againJamie 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