Link to home
Start Free TrialLog in
Avatar of al4629740
al4629740Flag for United States of America

asked on

If then in sql string

I am trying to write an sql statement and I know Im wrong below.

Essentially, if tblRegistration.Overage = 3, then AttendanceGrid Set X = 'X'
and  if tblRegistration.Overage is not 3, then AttendanceGrid Set X = ' '

How do I write that correctly below
Update AttendanceGrid Set X = 'X'
FROM tblRegistration INNER JOIN AttendanceGrid  on tblRegistration.id=AttendanceGrid.id 
and tblRegistration.Overage = 3
Else
Update AttendanceGrid Set X = ''
FROM tblRegistration INNER JOIN AttendanceGrid  on tblRegistration.id=AttendanceGrid.id 
and tblRegistration.Overage < 3

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Aneesh
Aneesh
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial