Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

URGENT Help, Please!!!

Status
Not open for further replies.

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.
 
Assuming the table name is "a", try removing the word "table" from your SQL statement.
 
thanks for responding but that is not the problem.
I put table a here. it is not coded that way in my program.
thanks again for trying to help
 
hi simflex

don't you need to reverse your variables?

update table a set receiveDate = IIF(isnull(sendDate),null,dateadd("d",10,sendDate))

keep us posted
lightseeker
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top