SQL Language (MOSC)

MOSC Banner

Need Assistance With Dates Again

edited Jan 25, 2011 2:13AM in SQL Language (MOSC) 4 commentsAnswered
 Hi Folks

need some help in seeing if i can use this sql statement to get correct results


col_date BETWEEN TO_DATE ('2005','yyyy') and TO_DATE ('2010','yyyy')

it will not give me everything for 2010, so i want to know if i have to use statements like the following :

col_date BETWEEN TO_DATE ('20050101','yyyymmdd') and TO_DATE ('20101231 23:59:59','yyyymmdd HH24:MI:SS')
col_date >= trunc (to_date('20050101','yyyymmdd')) and col_date < trunc (to_date('20101231','yyyymmdd')) + 1

I would just like to expand on the first statement, just using 'yyyy'

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center