I am trying to convert values in the numeric field [HW] that are negative
into zeros while keeping positive values unchanged.
when I try the expression IIf([HW]<0,0,[HW]) as a crosstab query criteria
the negative values all come out as 1, while the positive values remain
unchanged.
Does anyone know why I am getting 1 instead of 0 and what to do about it?
CS Hayes - 29 Mar 2007 02:52 GMT
update query:
http://office.microsoft.com/en-us/access/HP051880881033.aspx
make your search criteria "<0"
update value "0"
(omit quotation marks)

Signature
Chris Hayes
Still a beginner
> I am trying to convert values in the numeric field [HW] that are negative
> into zeros while keeping positive values unchanged.
[quoted text clipped - 4 lines]
>
> Does anyone know why I am getting 1 instead of 0 and what to do about it?
Allen Browne - 29 Mar 2007 03:05 GMT
In design view of your crosstab, what do you have in the Group By row?
Is it Count? That would make sense (counting 1 record.)

Signature
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
>I am trying to convert values in the numeric field [HW] that are negative
> into zeros while keeping positive values unchanged.
[quoted text clipped - 4 lines]
>
> Does anyone know why I am getting 1 instead of 0 and what to do about it?
Dan - 29 Mar 2007 04:42 GMT
Thanks Allen
I just had Group By left there. What should it be?
> In design view of your crosstab, what do you have in the Group By row?
>
[quoted text clipped - 8 lines]
> >
> > Does anyone know why I am getting 1 instead of 0 and what to do about it?
Allen Browne - 29 Mar 2007 17:43 GMT
Switch the query to SQL View (View menu), and post the SQL statement. It
might help us to see what's going on.

Signature
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
> Thanks Allen
>
[quoted text clipped - 15 lines]
>> > Does anyone know why I am getting 1 instead of 0 and what to do about
>> > it?