Sorting & Grouping Question

  • Thread starter Thread starter Matt
  • Start date Start date
M

Matt

Can anyone tell me the proper format for entering an
expression in the Sorting and Grouping fields so that I
can sort a report based on an expression I've created. I
keep getting syntax errors. Sample expression below:

iif([State]="AZ",1,iif([State]="GA",2,iif([State]
="NV",3,4)))

I want to sort by the resulting number.

Thanks,
Matt
 
Make sure you include an equal sign:
=iif([State]="AZ",1,iif([State]="GA",2,iif([State]="NV",3,4)))
You could also try a trick:
=100-Instr("-NV-GA-AZ-",[State])
 
I was missing the equal sign, now it works. Thanks Duane.


-----Original Message-----
Make sure you include an equal sign:
=iif([State]="AZ",1,iif([State]="GA",2,iif([State] ="NV",3,4)))
You could also try a trick:
=100-Instr("-NV-GA-AZ-",[State])

--
Duane Hookom
MS Access MVP
--

Can anyone tell me the proper format for entering an
expression in the Sorting and Grouping fields so that I
can sort a report based on an expression I've created. I
keep getting syntax errors. Sample expression below:

iif([State]="AZ",1,iif([State]="GA",2,iif([State]
="NV",3,4)))

I want to sort by the resulting number.

Thanks,
Matt


.
 
Back
Top