473,500 Members | 1,748 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

currency data type


I have a statement that says

if [field]=null then [field]=0

to change the field from a possible null to a 0

the field is a type currency and when it runs it will not change it to a 0

I have calculations that needs to work off the value of the field and they
will not work since it is a null. I could change the info later but it is in
a query and do not know how to do that later change.
--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200507/1
Nov 13 '05 #1
10 4102
"Mark Carlyle via AccessMonster.com" <fo***@AccessMonster.com> wrote in
news:51***********@AccessMonster.com:

I have a statement that says

if [field]=null then [field]=0

to change the field from a possible null to a 0

the field is a type currency and when it runs it will not change it to
a 0

I have calculations that needs to work off the value of the field and
they will not work since it is a null. I could change the info later
but it is in a query and do not know how to do that later change.


No field is a Null. Null means unknown, not given. It is not a value.

Null is not equal to Null. Nothing is equal to Null. Generally we test for
Null with the assertion Is Null.

We should not use zero for null. Zero is not Null. Mathemtical calculations
which use zero for Null are often flawed.

GUIs which accept default Null in place of default zero lack rigor.

***

But

In your calculations you could use:

Nz(Field, 0)

You could look up Nz in Access/VBA help to learn about it.
Nov 13 '05 #2
"Mark Carlyle via AccessMonster.com" <fo***@AccessMonster.com> wrote in
news:51***********@AccessMonster.com:

I have a statement that says

if [field]=null then [field]=0

to change the field from a possible null to a 0

the field is a type currency and when it runs it will not change it to
a 0

I have calculations that needs to work off the value of the field and
they will not work since it is a null. I could change the info later
but it is in a query and do not know how to do that later change.


No field is a Null. Null means unknown, not given. It is not a value.

Null is not equal to Null. Nothing is equal to Null. Generally we test for
Null with the assertion Is Null.

We should not use zero for null. Zero is not Null. Mathemtical calculations
which use zero for Null are often flawed.

GUIs which accept default Null in place of default zero lack rigor.

***

But

In your calculations you could use:

Nz(Field, 0)

You could look up Nz in Access/VBA help to learn about it.
Nov 13 '05 #3
On Fri, 15 Jul 2005 17:34:25 GMT, "Mark Carlyle via AccessMonster.com"
<fo***@AccessMonster.com> wrote:

I have a statement that says

if [field]=null then [field]=0

to change the field from a possible null to a 0

the field is a type currency and when it runs it will not change it to a 0

I have calculations that needs to work off the value of the field and they
will not work since it is a null. I could change the info later but it is in
a query and do not know how to do that later change.
--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200507/1


Look up the function Nz in help. In particular Nz(x,0) is zero if x is
null and equals x otherwise (not sure about types in the latter case).

In spite of what Lyle recommends Access treats null as a value, with
the special properties that comparing it with anything gives the
answer false, and with the special function isnull() and (in SQL) IS
NULL.

Ideally null wouldn't exist (!) but it cannot be avoided in outer
joins, for example.

Nov 13 '05 #4
On Fri, 15 Jul 2005 17:34:25 GMT, "Mark Carlyle via AccessMonster.com"
<fo***@AccessMonster.com> wrote:

I have a statement that says

if [field]=null then [field]=0

to change the field from a possible null to a 0

the field is a type currency and when it runs it will not change it to a 0

I have calculations that needs to work off the value of the field and they
will not work since it is a null. I could change the info later but it is in
a query and do not know how to do that later change.
--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200507/1


Look up the function Nz in help. In particular Nz(x,0) is zero if x is
null and equals x otherwise (not sure about types in the latter case).

In spite of what Lyle recommends Access treats null as a value, with
the special properties that comparing it with anything gives the
answer false, and with the special function isnull() and (in SQL) IS
NULL.

Ideally null wouldn't exist (!) but it cannot be avoided in outer
joins, for example.

Nov 13 '05 #5
rude person wrote:
In spite of what Lyle recommends Access treats null as a value, with
the special properties that comparing it with anything gives the
answer false
Actually it gives the answer null, not false. It may look false because
it fails any condition by not being true, e.g.

if a = null then
' this bit will never execute
endif

if a <> null then
' neither will this
endif
Ideally null wouldn't exist (!) but it cannot be avoided in outer
joins, for example.


It doesn't exist as such, but must exist in order to at least satisfy
Codd's 3rd rule

--
[OO=00=OO]
Nov 13 '05 #6
rude person wrote:
In spite of what Lyle recommends Access treats null as a value, with
the special properties that comparing it with anything gives the
answer false
Actually it gives the answer null, not false. It may look false because
it fails any condition by not being true, e.g.

if a = null then
' this bit will never execute
endif

if a <> null then
' neither will this
endif
Ideally null wouldn't exist (!) but it cannot be avoided in outer
joins, for example.


It doesn't exist as such, but must exist in order to at least satisfy
Codd's 3rd rule

--
[OO=00=OO]
Nov 13 '05 #7
In Access 2003 (tested only on my laptop) operations with nulls
generate run-time errors. Yay! Who said there was nothing new or better
in Access 2003?

Nov 13 '05 #8
In Access 2003 (tested only on my laptop) operations with nulls
generate run-time errors. Yay! Who said there was nothing new or better
in Access 2003?

Nov 13 '05 #9
On Sat, 16 Jul 2005 15:01:39 +0100, Trevor Best <no****@besty.org.uk>
wrote:
rude person wrote:
In spite of what Lyle recommends Access treats null as a value, with
the special properties that comparing it with anything gives the
answer false


Actually it gives the answer null, not false. It may look false because
it fails any condition by not being true, e.g.

if a = null then
' this bit will never execute
endif

if a <> null then
' neither will this
endif

True. Or perhaps I should say "Correct"

By treating null like a value I meant that you can assign it and set
it as a default value. In fact you can even include it in a select
list (in JET and Oracle for example). These are cases where you have
something in your hand and decide to set its value to null, rather
than null occuring "naturally" as it were.
Ideally null wouldn't exist (!) but it cannot be avoided in outer
joins, for example.


It doesn't exist as such, but must exist in order to at least satisfy
Codd's 3rd rule

Nov 13 '05 #10
On Sat, 16 Jul 2005 15:01:39 +0100, Trevor Best <no****@besty.org.uk>
wrote:
rude person wrote:
In spite of what Lyle recommends Access treats null as a value, with
the special properties that comparing it with anything gives the
answer false


Actually it gives the answer null, not false. It may look false because
it fails any condition by not being true, e.g.

if a = null then
' this bit will never execute
endif

if a <> null then
' neither will this
endif

True. Or perhaps I should say "Correct"

By treating null like a value I meant that you can assign it and set
it as a default value. In fact you can even include it in a select
list (in JET and Oracle for example). These are cases where you have
something in your hand and decide to set its value to null, rather
than null occuring "naturally" as it were.
Ideally null wouldn't exist (!) but it cannot be avoided in outer
joins, for example.


It doesn't exist as such, but must exist in order to at least satisfy
Codd's 3rd rule

Nov 13 '05 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
12277
by: Brandon McCombs | last post by:
hello, I have an app that pops up a custom dialog box and one of the fields for user input is an account balance field. The data gets put into an Object and eventually into an instance of...
0
1240
by: Tim Roberts | last post by:
It looks to me like the handling of the currency type in an ADODB connecction from Python is broken. Currency data in an Access database is stored as a 64-bit integer, scaled by 10000. In an...
2
4418
by: techy techno | last post by:
hii Experts..!! I need someone to tell me where I can get a Currency Converter like http://cconv.textor.com please can someone tell me where I can get it I need it for free + I dont need...
2
9589
by: Dalan | last post by:
This should not be an issue, but it is. I'm sure that someone knows what little piece of code is needed too persuade Access 97 to include a currency format for labels (Avery, mailing type). Have...
2
6421
by: Baybars | last post by:
New to access, but to deja.com. Looked through many posts, but can not find a good post for my problem (I believe there is, but my access level didn't allow me to understand). I have a table for...
11
2934
by: Adrian | last post by:
Hi I want to use the following declarations but vb dotnet keeps complaining that currency can't be used because it private ? I have tried it in a module and in the declaration pare same error!...
2
2221
by: sck10 | last post by:
Hello, I have a SQL Server 2K table with a field set to currency. When I try to insert or update a FormView, I get the following error: Disallowed implicit conversion from data type nvarchar...
14
4242
by: Scott M. | last post by:
Ok, this is driving me nuts... I am using VS.NET 2003 and trying to take an item out of a row in a loosely-typed dataset and place it in a label as a currency. As it is now, I am getting my...
2
1609
by: sam | last post by:
Hello, I have to make some development in VB.NET for managing money data. I used tu made these kind of development with currency type when I worked in VB6 but here in VB.NET, I can't find this...
1
1838
by: =?Utf-8?B?SGlwSG9wcGVy?= | last post by:
Hi, What's the Minimum and Maximum value for RangeValidator currency type? For example form -99,999,999,999,999 to 99,999,999,999,999? -- HipHopper
0
7136
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7018
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7182
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,...
1
6906
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
7397
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...
0
4611
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3110
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3106
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1430
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.