Let’s say I have two dates in my table, DueDate and PaidDate. What I need to do is calculate the difference between those two dates. However, if the DateDiff() returns less than 0, it should show 0.
DateDiff(Day, 0, (PaidDate-DueDate-1)) as DelayDays
Should show 0 for anything less than 1.
Thank you.
First off, that’s not how you use DateDiff. This is how you use it:
To get a zero value, just compare the dates:
(I’m not sure however which date you want to normally be the later one, i.e. if you want to calculate the time left or the time over due, so you might need to swap them around. As it stands now it calculates the time left.)