Question : Query to add columns

I have the attached script working
However I would like to combine 2 of the columns into one (Full Color and Two Color) called just Color.

So instead of:
UserID  User FullColor Two Color  BW  Total

I would have
UserID  User  Color  BW  Total
Where Color is the 2 columns added together

How do I do this?

I have tried the SUM commnad but it adds up Everything it seems
1:
2:
3:
4:
5:
6:
SELECT TBLusers.[User ID], TBLusers.User, 
TBL_DATA.[Copy + Print_Total_Full Color] As [Full Color],
TBL_DATA.[Copy + Print_Total_Two-color] As [Two Color],
TBL_DATA.[Copy + Print_Total_Black] as BW, TBL_DATA.[Copy + Print_Total_Total] As Total
FROM TBLusers INNER JOIN TBL_DATA ON TBLusers.[User ID] = TBL_DATA.[Account name]
WHERE (Month(TBL_DATA.[DateStamp])=5) and TBL_DATA.[Device]='230';

Answer : Query to add columns

For clarity, and to promote good coding practice, one should always declare variables before their use.

Looking at your function, there is no way to tell a) if the variables are simply undeclared, or b) are global variables declared outside the function.

You could use "Case...End Case" instead of the multiple "If...End If" statements:

1:
2:
3:
4:
5:
6:
7:
8:
Select Case usrSelect 
    Case "1"
        sservername = "10.0.2.3"
    Case "2"
        sservername = "10.10.10.1"
    Case "3"
        sservername = "Lama"
End Case
Random Solutions  
 
programming4us programming4us