View Full Version : 2+3 = 23 ?


piet123
05-26-2007, 11:56 PM
in the qry design grid i have 2 columns:

totfield1: (Nz([field1],0)) | totfield2: (Nz([field2],0))

then

in a 3rd column i have

grndtot: [totfield1]+[totfield2]

all works okay except:

if field1 value is 2
and
field2 value is 3
i get
grndtot as 23 instead of 5 !

i could do it before but i forgot how.

please help.

thanks
piet.

stopher
05-27-2007, 12:26 AM
You have field1 & field2 set up as text fields. So the + operator is just gluing two bits of text together.

You need to change your fields to numeric in the table design. Then the calculation will work.

hth
Stopher

piet123
05-27-2007, 04:08 AM
sorry, my mistake (stupid, stupid stupid mistake) .
it happens sometimes at 2am.

the qry was based upon another qry where i was counting a text field with a 'where' clause. problem is that i also had a 'group by' where i should have had a 'where' in another [date] field.

fixed now.

thanks anyway.
piet.