Guest_imported
New member
- Jan 1, 1970
- 0
I have two fields on an access database table.
They are called sendDate and receiveDate.
My requirement is this:
If sendDate is blank, then leave receiveDate blank as well.
But if sendDate is not blank, add 10 days to sendDate and update receiveDate with the new date.
I wrote the code like this:
update table a set sendDate = IIF(isnull(sendDate),null,dateadd("d",10,receiveDate)).
example, lets say that sendDate is July 12, 2001,
when I add 10 days to it, I need to be able to get July 22.
So it does not matter what receiveDate is, I want to replace it with this new date.
If on the other hand, sendDate is blank, I want to make sure that receiveDate is blank as well
This is not working.
Can someone help me urgently please.
Thanks in advance.
They are called sendDate and receiveDate.
My requirement is this:
If sendDate is blank, then leave receiveDate blank as well.
But if sendDate is not blank, add 10 days to sendDate and update receiveDate with the new date.
I wrote the code like this:
update table a set sendDate = IIF(isnull(sendDate),null,dateadd("d",10,receiveDate)).
example, lets say that sendDate is July 12, 2001,
when I add 10 days to it, I need to be able to get July 22.
So it does not matter what receiveDate is, I want to replace it with this new date.
If on the other hand, sendDate is blank, I want to make sure that receiveDate is blank as well
This is not working.
Can someone help me urgently please.
Thanks in advance.