I am trying to get count from one of the table by using date but date value
is stored as string like 20000603 it is VARCHAR2 field

Begin
SELECT
count(*) into dt FROM employee where to_date(year_month_day,'YYYYMMDD') =
to_date('20000603','YYYYMMDD');
End;
It is throwing an error saying not a valid month when I execute this in
Toad.
Same thing if I execute like below  It works fine.

select next_day(to_date('20000603','YYYYMMDD')-7,'SUNDAY') into dt from
employee where rownum = 1;

Please let me know if any one knows why it is giving an error.

-- 
Thanks & Regards
Swaroop Thailuru Swamy

-- 
You received this message because you are subscribed to the Google
Groups "Oracle PL/SQL" group.
To post to this group, send email to Oracle-PLSQL@googlegroups.com
To unsubscribe from this group, send email to
oracle-plsql-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/Oracle-PLSQL?hl=en

Reply via email to