You can use CAST() function. See below
>I'd like to create a new field in an sql statement.
>I use this:
>
>
>SELECT table1.netto, table1.brutto,;
CAST(IIF(table1.netto==table1.brutto, table1.netto,0) AS N(8,2)) as netto2,;
>FROM table1;
>INTO CURSOR table2 READWRITE
>
>
>My problem:
>I'd like to create the field 'netto2' to be same as the field 'netto'. The field 'netto' is N(8,2).
>If netto and brutto in the first record of table1 is not equal, the netto2 field of table2 becomes N(1,0).
>How can I make it N(8,2) too?
--sb--