GPSJane
GPSJane

Reputation: 59

SQL IIF syntax for incorporating into query

I have looked it up but only get the basic syntax not how to incorporate with the rest of my SQL query.

Do I do this;

UPDATE survey
SET IIF ((survey.azimuth+180)>360, survey.azimuth=(survey.azimuth-180), survey.azimuth=(survey.azimuth+180)
;

Or this?

UPDATE survey
IIF ((survey.azimuth+180)>360, SET survey.azimuth=(survey.azimuth-180), SET survey.azimuth=(survey.azimuth+180)
;

Does CASE not work in Access?

Upvotes: 0

Views: 77

Answers (2)

PaulFrancis
PaulFrancis

Reputation: 5819

They both will not work. CASE is not supported in Access. you use this.

UPDATE 
    survey
SET 
    azimuth = IIF ((azimuth + 180) > 360, 
                   (azimuth - 180), 
                   (azimuth + 180));

Upvotes: 1

juergen d
juergen d

Reputation: 204854

UPDATE survey
SET azimuth = IIF (azimuth + 180 > 360, azimuth - 180, azimuth + 180)

Upvotes: 1

Related Questions