Dear All,
I'm trying to build a query that has to add blanks to a field value content to fill all the field fixed lenght.
I.e. Fixed field lenght = 8
Field content "ABNN" result "ABNN "
Field content "AB" result "AB "
and so on.
I did the following but it doesn't work :
Espr1:
IIf(Len([STRUEROG]="1");[STRUEROG] & " ";
IIf(Len([STRUEROG]="2");[STRUEROG] & " ";
IIf(Len([STRUEROG]="3");[STRUEROG] & " ";
IIf(Len([STRUEROG]="4");[STRUEROG] & " ";
IIf(Len([STRUEROG]="5");[STRUEROG] & " ";
IIf(Len([STRUEROG]="6");[STRUEROG] & " ";
IIf(Len([STRUEROG]="7");[STRUEROG] & " ";
IIf(Len([STRUEROG]="8");[STRUEROG];" "))))))))
What's the mistake ?
Is there a more intelligent but still "easy" way to do this calculation ?
I did also the following function that is faster to insert
STRUEROG_F1: IIf([STRUEROG] Is Null;" ";Replace(Format([STRUEROG];"@@@@@@@@");" ";" "))
It works but I need to perform a left alignment of the string.
Many thanks
Giovanni
I'm trying to build a query that has to add blanks to a field value content to fill all the field fixed lenght.
I.e. Fixed field lenght = 8
Field content "ABNN" result "ABNN "
Field content "AB" result "AB "
and so on.
I did the following but it doesn't work :
Espr1:
IIf(Len([STRUEROG]="1");[STRUEROG] & " ";
IIf(Len([STRUEROG]="2");[STRUEROG] & " ";
IIf(Len([STRUEROG]="3");[STRUEROG] & " ";
IIf(Len([STRUEROG]="4");[STRUEROG] & " ";
IIf(Len([STRUEROG]="5");[STRUEROG] & " ";
IIf(Len([STRUEROG]="6");[STRUEROG] & " ";
IIf(Len([STRUEROG]="7");[STRUEROG] & " ";
IIf(Len([STRUEROG]="8");[STRUEROG];" "))))))))
What's the mistake ?
Is there a more intelligent but still "easy" way to do this calculation ?
I did also the following function that is faster to insert
STRUEROG_F1: IIf([STRUEROG] Is Null;" ";Replace(Format([STRUEROG];"@@@@@@@@");" ";" "))
It works but I need to perform a left alignment of the string.
Many thanks
Giovanni