Search code examples
sum

What is this SQL doing: SUM(OF A_C2_1-A_C2_24)


I use ACCESS but would like to understand what the follow SAS statement SUM(OF A_C2_1-A_C2_24) is doing? My interpretation is that this is subtracting Column 2, Line 24 on Worksheet A from Column 2, Line 1 on Worksheet A. The reason why I ask is that Line 24 of Worksheet A is not a total so to get a total, at least in Access, I have to add Lines 1 through 24.

Thank you for taking the time to read and respond to this request.


Solution

  • A_C2_1-A_C2_24 means list of variable starting from A_C2_1, followed by A_C2_2 till A_C2_24. if you have sum all variables across various columns you have to mention sum(A_C2_1, A_C2_2 .... A_C2_24), instead of doing that you can mention them as sum(of A_C2_1-A_C2_24). This will make lot of less typing effort. below is link to understand concept of list of variables

    https://support.sas.com/documentation/cdl/en/lrcon/62955/HTML/default/viewer.htm#a000695105.htm