我的代码有问题,我想通了:
SELECT
pono,
convert(varchar,podate,103) as podate,
Convert(varchar,validity,103) as validity,
OriginalPOno, Sitename, Vendorname
FROM dbo.tbl_POR_PO_MAIN
WHERE originalpono not in (select originalpono from tbl_Despatch_POR_PO_Main)
AND pono not in (select pono from tbl_Despatch_POR_PO_Main)
AND status=15
AND (DATEDIFF(day,getdate(),validity)<=1)
ORDER BY sitename, validity, originalpono
这给了我以下错误:
从字符串转换日期时间时转换失败。
我该如何解决这个问题?