关于日期系统日期处理
SELECT
T_OD1.PLANT_CD,T_OD1.ITEM_CD,TO_CHAR (T_OD1.DUE_DATE,'yyyy/mm/dd'),TO_CHAR( T_OD1.PRD_START_DATE,'yyyy/mm/dd'),
T_OD1.DM_QTY FROM T_OD T_OD1
WHERE
T_OD1.PLANT_CD = 'Y2'
AND T_OD1.DUE_DATE < TO_DATE(TO_CHAR (sysdate,'yyyy/mm/dd'),'yyyy/mm/dd')
AND T_OD1.DM_QTY > 0
说明:
先将小于系统日期转换成字符,在将字符转换成日期格式 T_OD1.DUE_DATE < TO_DATE(TO_CHAR (sysdate,'yyyy/mm/dd'),'yyyy/mm/dd')
因T_OD1.DUE_DATE 原本是日期型的