I
Isis
I am wanting to use an update query in Access - I notice that you can
assemble the SQL visually by clicking fields and putting conditions in
certain fields, but I also noticed you can edit the SQL directly.
If I write my own SQL will the visual bit still work ?
I want to update a number of fields based on a condition - the field I
want to update depends on the value already in the field - can I do that
? Sort of like this;
Pseudo Code
UPDATE Main INNER JOIN NewImport ON Main.UID = NewImport.Field1
If Main.PayDate1 = 0 (not sure how to test if there is a date)
SET Main.PayDate1 = Date (Todays Date)
Else If Main.PayDate1 <> 0
SET Main.PayDate2 = Date (Todays Date)
End If
Not sure how SQL works with these types of conditions - any help
appreciated.
Thanks
assemble the SQL visually by clicking fields and putting conditions in
certain fields, but I also noticed you can edit the SQL directly.
If I write my own SQL will the visual bit still work ?
I want to update a number of fields based on a condition - the field I
want to update depends on the value already in the field - can I do that
? Sort of like this;
Pseudo Code
UPDATE Main INNER JOIN NewImport ON Main.UID = NewImport.Field1
If Main.PayDate1 = 0 (not sure how to test if there is a date)
SET Main.PayDate1 = Date (Todays Date)
Else If Main.PayDate1 <> 0
SET Main.PayDate2 = Date (Todays Date)
End If
Not sure how SQL works with these types of conditions - any help
appreciated.
Thanks