Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 2 / March 2007

Tip: Looking for answers? Try searching our database.

Converting negative numbers into a zero

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Dan - 29 Mar 2007 02:30 GMT
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?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.