PC Review


Reply
Thread Tools Rate Thread

Converting negative numbers into a zero

 
 
=?Utf-8?B?RGFu?=
Guest
Posts: n/a
 
      29th Mar 2007
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?
 
Reply With Quote
 
 
 
 
=?Utf-8?B?Q1MgSGF5ZXM=?=
Guest
Posts: n/a
 
      29th Mar 2007
update query:

http://office.microsoft.com/en-us/ac...880881033.aspx

make your search criteria "<0"
update value "0"
(omit quotation marks)


--
Chris Hayes
Still a beginner


"Dan" wrote:

> 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?

 
Reply With Quote
 
Allen Browne
Guest
Posts: n/a
 
      29th Mar 2007
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.)

--
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.

"Dan" <(E-Mail Removed)> wrote in message
news:7C8C9112-DD16-47AB-95ED-(E-Mail Removed)...
>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?


 
Reply With Quote
 
=?Utf-8?B?RGFu?=
Guest
Posts: n/a
 
      29th Mar 2007
Thanks Allen

I just had Group By left there. What should it be?

"Allen Browne" wrote:

> 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.)
>
> --
> 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.
>
> "Dan" <(E-Mail Removed)> wrote in message
> news:7C8C9112-DD16-47AB-95ED-(E-Mail Removed)...
> >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?

>
>

 
Reply With Quote
 
Allen Browne
Guest
Posts: n/a
 
      29th Mar 2007
Switch the query to SQL View (View menu), and post the SQL statement. It
might help us to see what's going on.

--
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.

"Dan" <(E-Mail Removed)> wrote in message
news:4C863F64-3C4B-43E1-B2BC-(E-Mail Removed)...
> Thanks Allen
>
> I just had Group By left there. What should it be?
>
> "Allen Browne" wrote:
>
>> 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.)
>>
>> "Dan" <(E-Mail Removed)> wrote in message
>> news:7C8C9112-DD16-47AB-95ED-(E-Mail Removed)...
>> >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?


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
converting positive numbers to negative numbers dmantzaaa Microsoft Excel Misc 1 29th Jan 2009 11:45 PM
Converting positive numbers to negative numbers =?Utf-8?B?VHJlZzY3?= Microsoft Excel Worksheet Functions 4 17th Jul 2006 03:57 PM
Converting negative numbers stored as text to numbers =?Utf-8?B?QUthbXJhbg==?= Microsoft Access 2 25th May 2006 04:03 PM
Converting negative numbers stored as text to numbers =?Utf-8?B?QUthbXJhbg==?= Microsoft Access 0 25th May 2006 03:54 PM
Converting Negative numbers to positive numbers Mark Microsoft Access Form Coding 2 28th Jul 2003 06:00 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:54 AM.