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

asked on

Scan table for records > 0

I have an Attendance Grid called tblAttendanceGrid.  I have the following columns

Month
Total
DataPresent

How can I write an SQL statement that scans my table and checks to see if anyone has a Total > 0 each month, it will put a "1" in the DataPresent column for that specific record.
Avatar of Paul MacDonald
Paul MacDonald
Flag of United States of America image

Something like...

SELECT Month, Total, CASE WHEN TOTAL > 0 THEN 1 END AS DataPresent FROM MyTable
Avatar of al4629740

ASKER

Yes, however I actually want to put a value of "1" into the actual table
ASKER CERTIFIED SOLUTION
Avatar of Paul MacDonald
Paul MacDonald
Flag of United States of America 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