Date in Oracle query

I am getting errors for the date.
Either "not a month" or literal string does not match...

Can you suggest another format?
thanks!
Beth


Select Enti_id, SURVEY_DT,TOT_SPEND
FROM Classify_web
WHERE classify_web.CURR_APR_MOV  =  'APPROVED'
AND classify_web.FUTUR_APR_MOV = 'APPROVED' 
AND classify_web.LEVEL_CD = 'ENTI'
AND RSN_VLDN_FLG = 'PASS'
AND SURVEY_DT <= '05/01/2008'
AND SURVEY_DT <= '05/31/2009'

Open in new window

ba_trainerAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Guy Hengel [angelIII / a3]Billing EngineerCommented:
change to this:
AND SURVEY_DT >= TO_DATE('05/01/2008', 'MM/DD/YYYY')
AND SURVEY_DT <  TO_DATE('05/01/2009', 'MM/DD/YYYY')

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
ba_trainerAuthor Commented:
Bless you!
Beth
0
Kevin CrossChief Technology OfficerCommented:
Try like this:
(note, I also changed the first <= to >=.  If you want SURVEY_DT to be <= both, then you can eliminate the first statement totally as any date <= 5/2008 will be <= 5/2009)
Select Enti_id, SURVEY_DT,TOT_SPEND
FROM Classify_web
WHERE classify_web.CURR_APR_MOV  =  'APPROVED'
AND classify_web.FUTUR_APR_MOV = 'APPROVED' 
AND classify_web.LEVEL_CD = 'ENTI'
AND RSN_VLDN_FLG = 'PASS'
AND SURVEY_DT >= '2008-05-01'
AND SURVEY_DT <= '2009-05-31'

Open in new window

0
Kevin CrossChief Technology OfficerCommented:
Ha, took too long typing out my response.

0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Enterprise Software

From novice to tech pro — start learning today.