al4629740
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.
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.
ASKER
Yes, however I actually want to put a value of "1" into the actual table
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SELECT Month, Total, CASE WHEN TOTAL > 0 THEN 1 END AS DataPresent FROM MyTable