I am trying to create an update trigger that will update a field if another field's value is 'Y'. I want the field to be populated with the current date-time. Here is my code so far:
I am getting an error "incorrect syntax near the keyword 'then'". Also I would like an expression to replace "A" with the current date-time.
Any insights appreciated.
Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports
"A fine is a tax for doing wrong. A tax is a fine for doing well.
" - unknown
Code:
CREATE TRIGGER ReadyToPickDateTimeStamp ON [dbo].[oeordhdr_sql]
FOR UPDATE
AS
if user_def_fld_2 = 'Y' then SET user_def_fld_3 = 'A'
I am getting an error "incorrect syntax near the keyword 'then'". Also I would like an expression to replace "A" with the current date-time.
Any insights appreciated.
Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports
"A fine is a tax for doing wrong. A tax is a fine for doing well.
" - unknown