I have a table that has integer columns called "Day1Reg","Day2Reg",..."Day7Reg", "Day1OT","Day2OT",..."Day7OT". I want to select all rows in the table, calculating 2 new columns called "WkReg" and "WkOT" that will be the total of DayxReg and DayxOT. The Dayx columns might be null. Here's the query so far:
select
*,
(Day1Reg+Day2Reg+Day3Reg+Day4Reg+Day5Reg+Day6Reg+Day7Reg) as WkReg,
(Day1OT+Day2OT+Day3OT+Day4OT+Day5OT+Day6OT+Day7OT) as WkOT
from
Week01
where
UserName = "JustMe"
The WkReg and WkOT columns are created, but have no values. There are integer values in several of the Dayx columns. No errors are returned, just blank values in WkReg and WkOT.
Aucun commentaire:
Enregistrer un commentaire