Re: Wildcard searching of dates
Re: Wildcard searching of dates
- Subject: Re: Wildcard searching of dates
- From: Art Isbell <email@hidden>
- Date: Wed, 25 Jun 2003 10:29:33 -1000
On Wednesday, June 25, 2003, at 09:53 AM, Dan wrote:
A statement like:
select * from table where date like 'Apr 03%'
works fine executed directly against SQLServer.
But if I code up an EOQualifier with a EOQualifierOperatorLike and set
its
value to 'Apr*2003' and pick a date column I get the following error:
Error JDBCColumn for setting date type for Apr 03- class = class
java.lang.String
It looks like the JDBC driver is trying to convert the value to a date
instead
of looking and seeing that the operator is a like and doing the right
thing.
Anyone else gotten around this?
Dates are a pain in general. Different DB's support specifying dates
in different default formats, so the conversion of a string (with or
without wildcard characters) to a date is probably DB-specific and
something that JDBC doesn't do.
I have found that many date searches must be specified using a date
range. So your example would need to be specified with a qualifier
format like "date >= %@ and date < %@" with NSTimestamp arguments
representing April 1 at midnight (first instance of April 1) and May 1
at midnight.
Aloha,
Art
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.