Is this the whole formula??? or just a part of it?
I have never tried to use IIF() in a summary function...If it worked that would be neat....but perhaps that cannot be done.
I can see nothing wrong if IIF is allowed, Also assuming that there is nothing missing in a formula .....
for example: this error commonly occurs when there is a missing semicolon (

at the end of a statement.
A work around is to use a 3-formula sum
@initialization (suppressed in the header)
WhilePrintingRecords;
if not in repeatedgroupheader then numbervar total := 0;
@CalcSum (suppressed in the details)
WhilePrintingRecords;
numbervar total ;
if {MODELO_REPARACIONES.garantia} = '1' then
total := total + 1;
@DisplayTotal (placed where you want in the footer
WhilePrintingRecords;
numbervar total ;
total ; Jim Broadbent