Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Is there a better way to choose the variables that I want?
Here's what I have so far and I need to expand it to 6 different choices rather than 3 'MemberInfo data for the GroupID If ClassVar1 = "" And ClassVar2 = "" And ClassVar3 = "" _ And PlanVar1 = "" And PlanVar2 = "" And PlanVar3 = "" _ And BusVar1 = "" And BusVar2 = "" And BusVar3 = "" _ Then strSQL = "Select SaCd, count(MemId)" & _ "From MemberInfoFacets " & _ "Where GroupID IN ('" & GroupVar1 & "','" & GroupVar2 & "', '" & GroupVar3 & "') " & _ " AND MemDate = " & INDV & _ " GROUP BY SaCd" 'MemberInfo data for the GroupID and ClassID ElseIf PlanVar1 = "" And PlanVar2 = "" And PlanVar3 = "" _ And BusVar1 = "" And BusVar2 = "" And BusVar3 = "" _ Then strSQL = "Select SaCd, count(MemId)" & _ "From MemberInfoFacets " & _ "Where GroupID IN ('" & GroupVar1 & "','" & GroupVar2 & "', '" & GroupVar3 & "') " & _ " And ClassID IN ('" & ClassVar1 & "','" & ClassVar2 & "', '" & ClassVar3 & "') " & _ " AND MemDate = " & INDV & _ " GROUP BY SaCd" 'MemberInfo data for the GroupID and BusCat ElseIf ClassVar1 = "" And ClassVar2 = "" And ClassVar3 = "" _ And PlanVar1 = "" And PlanVar2 = "" And PlanVar3 = "" _ Then strSQL = "Select SaCd, count(MemId)" & _ "From MemberInfoFacets " & _ "Where GroupID IN ('" & GroupVar1 & "','" & GroupVar2 & "', '" & GroupVar3 & "') " & _ " And BusCat IN ('" & BusVar1 & "','" & BusVar2 & "', '" & BusVar3 & "') " & _ " AND MemDate = " & INDV & _ " GROUP BY SaCd" 'MemberInfo data for the GroupID and ClassID and PlanID Else strSQL = "Select SaCd, count(MemId)" & _ "From MemberInfoFacets " & _ "Where GroupID IN ('" & GroupVar1 & "','" & GroupVar2 & "', '" & GroupVar3 & "') " & _ " And ClassID IN ('" & ClassVar1 & "','" & ClassVar2 & "', '" & ClassVar3 & "') " & _ " And PlanID IN ('" & PlanVar1 & "','" & PlanVar2 & "', '" & PlanVar3 & "') " & _ " AND MemDate = " & INDV & _ " GROUP BY SaCd" End If |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
how to write value | Excel Discussion (Misc queries) | |||
how to write ‘ | Excel Discussion (Misc queries) | |||
How do I write X^2? | New Users to Excel | |||
How do you write a T with a bar on it? | Excel Discussion (Misc queries) | |||
is it possible to execute write to the fields in another .xsl form a macro in another .xsl? e.g. some way to load another .xsl into an .xsl macro and write to its data? | Excel Worksheet Functions |