the TO_CHAR worked. Thanks Ronald and all that helped. Jim
> -----Original Message----- > From: Ronald J Kimball [mailto:rjk-dbi@;focalex.com] > Sent: Thursday, November 14, 2002 9:37 AM > To: Kipp, James > Cc: [EMAIL PROTECTED] > Subject: Re: Trying to get LIKE to work > > > > Since you mention sqlplus, I assume you are using Oracle... One > possibility is that the NLS_DATE_FORMAT (the default format for dates) > differs between your sqlplus and DBI sessions. > > I would recommend using TO_CHAR to format the date in the > WHERE clause: > > my $date = '7-Aug'; > > my $sth = $dbh->prepare(<<"EndOfSQL"); > SELECT * > FROM update > WHERE TO_CHAR(sdate, 'DD-Mon') LIKE ? > EndOfSQL > > $sth->execute("%$date%"); > > > In fact, if you're just looking for Aug 7, rather than Aug 7, > 17, & 27, you > can then use = instead of LIKE: > > my $date = '07-Aug'; > > my $sth = $dbh->prepare(<<"EndOfSQL"); > SELECT * > FROM update > WHERE TO_CHAR(sdate, 'DD-Mon') = ? > EndOfSQL > > $sth->execute($date); > > > I hope that's helpful! > > Ronald >
