Total Period Columns by Wildcard

jstevens
GoldLounger
Posts: 2628
Joined: 26 Jan 2010, 16:31
Location: Southern California

Total Period Columns by Wildcard

Post by jstevens »

I have a temporary table named #Temp. SQL code: Select * FROM #Temp results in
Account, Per01, Per02, Per03 ... Per12 as field headings.

Is it possible to add a "Total" field based on a wildcard such as "Per*" ?

I know that I can add each period to obtain what I want. The question is around wildcards.

Select *, Per01+Per02+Per03+Per04+... as Total
From #Temp

Your suggestions are appreciated.
Regards,
John

User avatar
HansV
Administrator
Posts: 78390
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Total Period Columns by Wildcard

Post by HansV »

There is no built-in option for this. You might create a VBA function for this purpose; it's up to yo to decide whether it's worth the trouble.
Best wishes,
Hans

jstevens
GoldLounger
Posts: 2628
Joined: 26 Jan 2010, 16:31
Location: Southern California

Re: Total Period Columns by Wildcard

Post by jstevens »

Thanks Hans!
Regards,
John