Hi,
I am trying to improve my SQL update as I believe it is not efficient.
The table contains various fields to deal with incidents. The one field "Updates" is a concatanated field. In other words each time there is a new update to the incident the field gets updated by adding the new update to what already exists in the "Updates" field.
Currently the Web/Sql system I have designed works as such...
I have a SQL Select that reads in the value of the "Updates" field.
I have a form that will be completed to give a NewUpdate.
I have an strAudit which comprises of Date/Time and UserName.
I then add these together to give NewUpdate = strAudit & NewUpdate.
I then add the value of "Updates" and the NewUpdate together by Updates = Updates & NewUpdate
Finally I have a SQL Update that updates "Updates" field with the new value
What I would like to do if possible is something like
UPDATE "table_name"
SET Update = Updates & [strAudit & NewUpdate]
WHERE {condition}
Is this possible? my attempts have given me errors and I have not found any SQL syntaxes that give this result.
Is it a case that I have to read, then add and then update?
Thanks
Mych
I am trying to improve my SQL update as I believe it is not efficient.
The table contains various fields to deal with incidents. The one field "Updates" is a concatanated field. In other words each time there is a new update to the incident the field gets updated by adding the new update to what already exists in the "Updates" field.
Currently the Web/Sql system I have designed works as such...
I have a SQL Select that reads in the value of the "Updates" field.
I have a form that will be completed to give a NewUpdate.
I have an strAudit which comprises of Date/Time and UserName.
I then add these together to give NewUpdate = strAudit & NewUpdate.
I then add the value of "Updates" and the NewUpdate together by Updates = Updates & NewUpdate
Finally I have a SQL Update that updates "Updates" field with the new value
What I would like to do if possible is something like
UPDATE "table_name"
SET Update = Updates & [strAudit & NewUpdate]
WHERE {condition}
Is this possible? my attempts have given me errors and I have not found any SQL syntaxes that give this result.
Is it a case that I have to read, then add and then update?
Thanks
Mych