I need to calculate date difference using flowing query but it does not work. Please advise.
SELECT ID, VoucherNo, DateRec, ProductID, Description, ClaimantCo, ClaimantName, City, Phone, DateReturn, ReqJob, WSIns, Remarks, Status, Part1, Part2, Part3, Part4, OtherWSCharges, FDCharges, P1Charges, P2Charges, P3Charges, P4Charges, DateJobBegun, DateJobDone, WSRemarks, TotChargesFromWS, DeliveryStatus, DateDelivered
FROM tblClaims
WHERE DateDiff(dd, DateReturn, GETDATE()) =3
My purpose is to get records for which three days are left to DateRetun, comparing to today’s date.
Thanks
I think you’ve just got the datediff parameters the wrong way round – if you’re looking for three days in the future you want to say: