SELECT pd_end_dt,nrx_cnt
FROM wkly_lnd.lnd_wkly_plan_rx_summary
WHERE pd_end_dt >TO_DATE('01/01/2009')
It is giving error ORA-01843: not a valid month
i ran the following it did fine
SELECT pd_end_dt,nrx_cnt FROM wkly_lnd.lnd_wkly_plan_rx_summary WHERE pd_end_dt > '01-Jan-09'
but if i want to have week wise data how to do dat
There are two possibilities:
The TO_DATE function is failing due to the default date format (as per other answers already given here).
The column
pd_end_dt
is not a date column. The query is trying to convert the values inpd_end_dt
to dates prior to the comparison, and failing on one of the rows.To demonstrate: