粘贴下面的查询下面不再获取输入。 这里DATE_WID是Number(10)数据类型。因为我想在2个约会之间,所以我想尝试一下。有人可以帮我吗?
SELECT NEXT_SCHEDULE.POSITION_DH_WID,
NEXT_SCHEDULE.ORG_WID,
NEXT_SCHEDULE.DATE_WID,
CONTACTED_CUSTOMERS.DATE_WID,
NEXT_SCHEDULE.SNAPSHOT_DT,
NEXT_SCHEDULE.SNAPSHOT_WEEK,
NEXT_SCHEDULE.CUSTOMER_WID,
DUE AS FUTURE_DUE
FROM WC_RT_CUST_DUE_2TO53WEEKS_VW NEXT_SCHEDULE,WC_RT_CUST_CONTACT_WEEKLY_VW CONTACTED_CUSTOMERS
WHERE NEXT_SCHEDULE.CUSTOMER_WID=CONTACTED_CUSTOMERS.CUSTOMER_WID AND
NEXT_SCHEDULE.POSITION_DH_WID=CONTACTED_CUSTOMERS.POSITION_DH_WID
and TO_DATE(NEXT_SCHEDULE.DATE_WID,'YYYY/MM/DD') BETWEEN
TO_DATE(CONTACTED_CUSTOMERS.DATE_WID, 'YYYY/MM/DD')+7 and TO_DATE(NEXT_SCHEDULE.DATE_WID,'YYYY/MM/DD')
--AND CONTACTED_CUSTOMERS.DATE_WID <>0 and NEXT_SCHEDULE.DATE_WID <>0
GROUP BY
NEXT_SCHEDULE.POSITION_DH_WID,
NEXT_SCHEDULE.ORG_WID,
NEXT_SCHEDULE.DATE_WID,
CONTACTED_CUSTOMERS.DATE_WID,`enter code here`
NEXT_SCHEDULE.SNAPSHOT_DT,
NEXT_SCHEDULE.SNAPSHOT_WEEK,
NEXT_SCHEDULE.CUSTOMER_WID, DUE
答案 0 :(得分:0)
日期转换:TO_DATE(CONTACTED_CUSTOMERS.DATE_WID, 'YYYY/MM/DD')
在这里是错误的。 (/
不能包含在具有NUMBER
数据类型的列中)
如果您的DATE_WID是数字,且格式为:“ YYYYMMDD”,则使用TO_DATE(CONTACTED_CUSTOMERS.DATE_WID, 'YYYYMMDD')
并类似。
但是,将日期存储在不同的数据类型中是一种不良做法。
干杯!