Home » RDBMS Server » Server Administration » How to - whether a Month,Year value falls between two date fields
How to - whether a Month,Year value falls between two date fields [message #375241] Wed, 08 August 2001 06:53 Go to next message
kundan
Messages: 5
Registered: August 2001
Junior Member
Iam looking for a sql statement which returns records where a given month,year falls between value of two date fields.

Table contains fields - date1 n date2
ex values
1,01-JUN-1999, 02-JUL-1999
2,01-FEB-1999, 02-MAR-1999
3,01-JUN-1999, 02-SEP-1999

now i need rows 1 and 2 for month,year=jun,1999

please help
thanx in advance
Re: How to - whether a Month,Year value falls between two date fields [message #375242 is a reply to message #375241] Wed, 08 August 2001 07:02 Go to previous messageGo to next message
Lars Sjöström
Messages: 24
Registered: June 2001
Junior Member
THis works, but it could have pitfalls I do not see at the moment. I am not sure to what date what to_Date('jun-1999') converts. But it works.

select * from table_test
where to_date('jun-2000','mon-yyyy') between from_date and to_date;
Re: How to - whether a Month,Year value falls between two date fields [message #375243 is a reply to message #375242] Wed, 08 August 2001 07:14 Go to previous message
kundan
Messages: 5
Registered: August 2001
Junior Member
Thanx.
Previous Topic: Re: DIFFERENCE BETWEEN ORACLE 8 AND ORACLE 8i
Next Topic: Oracle 8i DBA OCP cd CBT's for sale
Goto Forum:
  


Current Time: Tue Dec 24 07:29:51 CST 2024