473,394 Members | 1,715 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

NBV To Zero if There is Disposal

22
I have a query with the following fields cost, AccDpr, Disposal and NBV, what i want to do is to returned NBV to zero when their is any value i.e amount in disposal field. The NBV formula = [cost]-[Accdpr]. Pls Help
Jul 12 '18 #1

✓ answered by twinnyfo

I see. Thank you.

Just change the Formula to:

Expand|Select|Wrap|Line Numbers
  1. = IIf([Disposal] Is Not Null, 0, [cost]-[Accdpr])
Hope this hepps!

10 1520
twinnyfo
3,653 Expert Mod 2GB
Mafi,

My first advice to you is that you should never have a calculated field as part of a table. The MBV value should always be calculated in the query or report that uses the other three values. This eliminates your current concerns, and the MBV value will always be current and accurate.

Hope this hepps!
Jul 12 '18 #2
Mafi
22
All my calculated fields are in query not part of table.
Jul 12 '18 #3
NeoPa
32,556 Expert Mod 16PB
Is this as simple as saying :
Expand|Select|Wrap|Line Numbers
  1. IIf([Disposal]=0,0,[Cost]-[AccDpr]) AS [NBV]
Jul 12 '18 #4
twinnyfo
3,653 Expert Mod 2GB
I see. Thank you.

Just change the Formula to:

Expand|Select|Wrap|Line Numbers
  1. = IIf([Disposal] Is Not Null, 0, [cost]-[Accdpr])
Hope this hepps!
Jul 12 '18 #5
twinnyfo
3,653 Expert Mod 2GB
And NeoPa and I think alike!
Jul 12 '18 #6
Mafi
22
Twinnyfo u get it right but i did a little modification to work perfectly for me. = IIf([Disposal] Is Null, 0, [cost]-[Accdpr]). Thanks.
Jul 13 '18 #7
twinnyfo
3,653 Expert Mod 2GB
But I thought that if there was a value in Disposal, that NBV was set to 0? Your formula says the opposite, that if Disposal is empty, NBV is 0.
Jul 13 '18 #8
Mafi
22
Neopa thank you also for ur contribution.
Jul 13 '18 #9
NeoPa
32,556 Expert Mod 16PB
Interesting. So, when you say "When [Disposal] has no value" you actually mean when there is no value set, rather than when the value is zero (0). That's a hard concept to express clearly so it's understandable you left us confused.

Mafi:
what i want to do is to returned NBV to zero when their is any value i.e amount in disposal field.
If your adjusted code is what you want then your original question was back-to-front. As such, Twinny's answer was perfect and I'll set it as Best Answer. That doesn't mean you have to use it directly, but anyone else looking for a solution to a similar question will find his answer most helpful.
Jul 13 '18 #10
NeoPa
32,556 Expert Mod 16PB
Mafi:
Neopa thank you also for ur contribution.
My pleasure. If I'd understood you better I'd have given you the same solution Twinny did, but they were both close enough to work from. Glad you're sorted :-)
Jul 13 '18 #11

Sign in to post your reply or Sign up for a free account.

Similar topics

248
by: Generic Usenet Account | last post by:
As per Google's Usenet archives http://groups.google.com/googlegroups/archive_announce_20.html], the first discussion of the Y2K problem on the Usenet was on January 18 1985...
53
by: Zhiqiang Ye | last post by:
Hi, All I am reading FAQ of this group. I have a question about this: http://www.eskimo.com/~scs/C-faq/q7.31.html It says: " p = malloc(m * n); memset(p, 0, m * n); The zero fill is...
31
by: RS | last post by:
Hi, Looking to see if the following construct is valid: typedef struct { int foo; char bar; } foobar; Basically, the idea is to have the structure above point to a message buffer that has...
3
by: Chris | last post by:
I am just wondering if I did this the best way possible. I needed to add a double boarder around a label box. So I made a pen in the class, and do the drawing of the rectangles in the onpaint...
33
by: Zytan | last post by:
I want to make a zero element array. I know that Nothing is not the same as a zero element array, since I can't get the length of, or iterate through, an array = Nothing. I could make a zero...
12
by: horacius.rex | last post by:
Hi, I have a code that in some part of the program calculates 1/x for a lot of different x's. About 1 of 100 times x is equal to zero, so when I print the result I obtain inf. I wonder if there...
20
by: Ravikiran | last post by:
Hi Friends, I wanted know about whatt is ment by zero optimization and sign optimization and its differences.... Thank you...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.