Hi,
I need some help with coding so that I can put a date in a field "datetopayroll" but only if the field is blank. I'm sending an email grouped by a code number and when it is sent it will put a date in a field. But all records with the same code number might not be available to get sent at the same time so if a group of the code numbers gets sent today I don't want todays date to go into the field of the group of the same code numbers that got sent yesterday. I hope this is clear but I will be happy to explain further. Here is the code that I use at the moment to add the date.
SQL = "UPDATE tbltruststaff " & _
"SET datetopayroll = date()WHERE Code IN (" & strCode & ")" _
I need some help with coding so that I can put a date in a field "datetopayroll" but only if the field is blank. I'm sending an email grouped by a code number and when it is sent it will put a date in a field. But all records with the same code number might not be available to get sent at the same time so if a group of the code numbers gets sent today I don't want todays date to go into the field of the group of the same code numbers that got sent yesterday. I hope this is clear but I will be happy to explain further. Here is the code that I use at the moment to add the date.
SQL = "UPDATE tbltruststaff " & _
"SET datetopayroll = date()WHERE Code IN (" & strCode & ")" _