Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: LIKE Clause with dates?

Re: LIKE Clause with dates?

From: hazledid <david.hazledine_at_roche.com>
Date: Tue, 22 Jun 1999 14:42:21 GMT
Message-ID: <hhNb3.13425$Xr4.108500@c01read02-admin.service.talkway.com>


Sally,

Let me get this right. You're supplying a date as an input argument, and you want the procedure to identify all records whose date is the same month and year as the input date, but the day can be anything. In your example the input date is 31 Mar 1999 and you want to procedure to pick up all dates in March 1999. Is that correct?

If so, and assuming that the column "datepart" is of type date, you could do it like this:

where datepart between
to_date('01'||to_char(asofdate,'MMYYYY'),'DDMMYYYY') and last_day(asofdate)

David J. Hazledine
Roche Products Limited
40 Broadwater Road
Welwyn Garden City
AL7 3AY
United Kingdom
Registration Number 100674

E-mail: david.hazledine_at_roche.com
Fax: +44 (0)1707 325666
Tel: +44 (0)1707 366166
--
Posted via Talkway - http://www.talkway.com Exchange ideas on practically anything (tm). Received on Tue Jun 22 1999 - 09:42:21 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US