C
Confused
Hi,
I currently have a query with a list of calls from a call
log database. Within this query i have LocationDesc and
Practice. I want to group the LocationDesc dependant on
the Practice. For example this is what I currently have in
my table:
Pratice LocationDesc
------------------------------------------------
National Practice Toronto (30010)
National Practice Toronto - Bay Street (30030)
National Shared Ser Toronto University (30018
Ragional Practice Regions
National Practice Calgary
National Practice Calgary (30620)
The table is much more extensive then this but this gives
a basic idea.
I put a column in my query next to LoctionDescr and named
it Geography. I then added a IFF function that reads:
Geography: IIf([Practice]="National Practice" And
[LocationDescr]="Calgary (30620)","Calgary",IIf([Practice]
="National Practice" And [LocationDescr]
="Calgary","Calgary",IIf([Practice]="National Practice"
And [LocationDescr]="Toronto (30010)","GTA",IIf([Practice]
="National Practice" And [LocationDescr]="Toronto - Bay
Street (30030)","GTA",IIf([Practice]="National Practice"
And [LocationDescr]="Toronto University (30018)","GTA",IIf
([Practice]="National Practice" And [LocationDescr]
="Vaughan (30016)","GTA",IIf([Practice]="National
Practice" And [LocationDescr]="Mississauga
(30013)","GTA",IIf([Practice]="National Practice" And
[LocationDescr]="National - 40 University
(30993)","GTA",IIf([Practice]="National Practice" And
[LocationDescr]="National (CCW) (30991)","GTA",IIf
([Practice]="National Practice" And [LocationDescr]
="National (University) (30990)","GTA",IIf([Practice]
="National Practice" And [LocationDescr]="North York
(30014)","GTA","No Data")))))))))))
This works fine, but I still have other groupings that I
want to do. However, when I add more, I get an
error "Sting cannot be longer then 255 charcters long".
Is there another way I can write this function or is there
any other way to perform this action. I have attempted to
put the function straight into Excel but Excel does not
allow more then 7 IF statements.
I will be using this as part of a macro, which pulls data
from the Access database to excel and performs a number of
grouping as above.
Any help is greatly appreciated.
Many thanks
I currently have a query with a list of calls from a call
log database. Within this query i have LocationDesc and
Practice. I want to group the LocationDesc dependant on
the Practice. For example this is what I currently have in
my table:
Pratice LocationDesc
------------------------------------------------
National Practice Toronto (30010)
National Practice Toronto - Bay Street (30030)
National Shared Ser Toronto University (30018
Ragional Practice Regions
National Practice Calgary
National Practice Calgary (30620)
The table is much more extensive then this but this gives
a basic idea.
I put a column in my query next to LoctionDescr and named
it Geography. I then added a IFF function that reads:
Geography: IIf([Practice]="National Practice" And
[LocationDescr]="Calgary (30620)","Calgary",IIf([Practice]
="National Practice" And [LocationDescr]
="Calgary","Calgary",IIf([Practice]="National Practice"
And [LocationDescr]="Toronto (30010)","GTA",IIf([Practice]
="National Practice" And [LocationDescr]="Toronto - Bay
Street (30030)","GTA",IIf([Practice]="National Practice"
And [LocationDescr]="Toronto University (30018)","GTA",IIf
([Practice]="National Practice" And [LocationDescr]
="Vaughan (30016)","GTA",IIf([Practice]="National
Practice" And [LocationDescr]="Mississauga
(30013)","GTA",IIf([Practice]="National Practice" And
[LocationDescr]="National - 40 University
(30993)","GTA",IIf([Practice]="National Practice" And
[LocationDescr]="National (CCW) (30991)","GTA",IIf
([Practice]="National Practice" And [LocationDescr]
="National (University) (30990)","GTA",IIf([Practice]
="National Practice" And [LocationDescr]="North York
(30014)","GTA","No Data")))))))))))
This works fine, but I still have other groupings that I
want to do. However, when I add more, I get an
error "Sting cannot be longer then 255 charcters long".
Is there another way I can write this function or is there
any other way to perform this action. I have attempted to
put the function straight into Excel but Excel does not
allow more then 7 IF statements.
I will be using this as part of a macro, which pulls data
from the Access database to excel and performs a number of
grouping as above.
Any help is greatly appreciated.
Many thanks