I have a problem in my code and I figure it out:
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
This gives me a following error:
Conversion failed when converting datetime from character string.
How do I solve this problem?
Found this thread:
Sounds like this could be the issue,maby you should take a looka the podate structure.