473,387 Members | 1,486 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,387 software developers and data experts.

Calculated fields

I am trying to use calculated fields in my query but all the results
are zero ven when they're not. Please help. Thanks.
Nov 12 '05 #1
5 4021
John, can you post an example of your calculated query field?

One possible cause is the use of Nulls. If the expression is made up of
various parts, you may need to wrap Nz() around each one.

Another is that Access can misunderstand the intended data type, so you may
need to explicitly typecast. Details in article:
Calculated fields misinterpreted
at:
http://allenbrowne.com/ser-45.html
--
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.

"John Bahran" <jo********@hotmail.com> wrote in message
news:ae**************************@posting.google.c om...
I am trying to use calculated fields in my query but all the results
are zero ven when they're not. Please help. Thanks.

Nov 12 '05 #2
Thank you very much for your reply.I had a database query of 5 fields,
name,address,age , multiplier and result.Age and multiplier are
numbers. They are multiplied and if >0 are put in result. But I get 0
everywhere.
"Allen Browne" <Al*********@SeeSig.Invalid> wrote in message news:<40***********************@freenews.iinet.net .au>...
John, can you post an example of your calculated query field?

One possible cause is the use of Nulls. If the expression is made up of
various parts, you may need to wrap Nz() around each one.

Another is that Access can misunderstand the intended data type, so you may
need to explicitly typecast. Details in article:
Calculated fields misinterpreted
at:
http://allenbrowne.com/ser-45.html
--
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.

"John Bahran" <jo********@hotmail.com> wrote in message
news:ae**************************@posting.google.c om...
I am trying to use calculated fields in my query but all the results
are zero ven when they're not. Please help. Thanks.

Nov 12 '05 #3
In query design view, in the Field row, you have numeric fields named
Multipler and Age, and then you have a calculated field that looks like
this:
Expr1: [Multiplier] * [Age]

The query shows zero on every row, no matter what values are in the
Multiplier and Age fields? If so, is the zero displayed left-aligned or
right-aligned?

Or have I misunderstood what you are saying?

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

"John Bahran" <jo********@hotmail.com> wrote in message
news:ae**************************@posting.google.c om...
Thank you very much for your reply.I had a database query of 5 fields,
name,address,age , multiplier and result.Age and multiplier are
numbers. They are multiplied and if >0 are put in result. But I get 0
everywhere.
"Allen Browne" <Al*********@SeeSig.Invalid> wrote in message

news:<40***********************@freenews.iinet.net .au>...
John, can you post an example of your calculated query field?

One possible cause is the use of Nulls. If the expression is made up of
various parts, you may need to wrap Nz() around each one.

Another is that Access can misunderstand the intended data type, so you may need to explicitly typecast. Details in article:
Calculated fields misinterpreted
at:
http://allenbrowne.com/ser-45.html

"John Bahran" <jo********@hotmail.com> wrote in message
news:ae**************************@posting.google.c om...
I am trying to use calculated fields in my query but all the results
are zero ven when they're not. Please help. Thanks.

Nov 12 '05 #4
You understood it perfectly. The zeros are right-aligned. Thank you.
"Allen Browne" <Al*********@SeeSig.Invalid> wrote in message news:<40***********************@freenews.iinet.net .au>...
In query design view, in the Field row, you have numeric fields named
Multipler and Age, and then you have a calculated field that looks like
this:
Expr1: [Multiplier] * [Age]

The query shows zero on every row, no matter what values are in the
Multiplier and Age fields? If so, is the zero displayed left-aligned or
right-aligned?

Or have I misunderstood what you are saying?

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

"John Bahran" <jo********@hotmail.com> wrote in message
news:ae**************************@posting.google.c om...
Thank you very much for your reply.I had a database query of 5 fields,
name,address,age , multiplier and result.Age and multiplier are
numbers. They are multiplied and if >0 are put in result. But I get 0
everywhere.
"Allen Browne" <Al*********@SeeSig.Invalid> wrote in message

news:<40***********************@freenews.iinet.net .au>...
John, can you post an example of your calculated query field?

One possible cause is the use of Nulls. If the expression is made up of
various parts, you may need to wrap Nz() around each one.

Another is that Access can misunderstand the intended data type, so you may need to explicitly typecast. Details in article:
Calculated fields misinterpreted
at:
http://allenbrowne.com/ser-45.html

"John Bahran" <jo********@hotmail.com> wrote in message
news:ae**************************@posting.google.c om...
> I am trying to use calculated fields in my query but all the results
> are zero ven when they're not. Please help. Thanks.

Nov 12 '05 #5
John, are we talking Access tables (not linked ODBC)?
If so, I am intrigued by this behavior. Email me using the address in the
sig. below, and include the text of this thread.

In table design view, what is the Field Size of the two Number fields?
Double? Long? Decimal? (Access does handle the Decimal type poorly.)

What version numbers do you have for:
- msaccess.exe (typically in \Program Files\Microsoft Office\Office)
- msjet40.dll (typically in Windows\system32)
Right-click the file in Windows Explorer, and choose Properties | Version.
(For Access 97, the 2nd file will be msjet35.dll.)

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

"John Bahran" <jo********@hotmail.com> wrote in message
news:ae*************************@posting.google.co m...
You understood it perfectly. The zeros are right-aligned. Thank you.

"Allen Browne" <Al*********@SeeSig.Invalid> wrote in message

news:<40***********************@freenews.iinet.net .au>...
In query design view, in the Field row, you have numeric fields named
Multipler and Age, and then you have a calculated field that looks like
this:
Expr1: [Multiplier] * [Age]

The query shows zero on every row, no matter what values are in the
Multiplier and Age fields? If so, is the zero displayed left-aligned or
right-aligned?

Or have I misunderstood what you are saying?

"John Bahran" <jo********@hotmail.com> wrote in message
news:ae**************************@posting.google.c om...
Thank you very much for your reply.I had a database query of 5 fields,
name,address,age , multiplier and result.Age and multiplier are
numbers. They are multiplied and if >0 are put in result. But I get 0
everywhere.
"Allen Browne" <Al*********@SeeSig.Invalid> wrote in message

news:<40***********************@freenews.iinet.net .au>...
> John, can you post an example of your calculated query field?
>
> One possible cause is the use of Nulls. If the expression is made up of > various parts, you may need to wrap Nz() around each one.
>
> Another is that Access can misunderstand the intended data type, so you
may
> need to explicitly typecast. Details in article:
> Calculated fields misinterpreted
> at:
> http://allenbrowne.com/ser-45.html
>
> "John Bahran" <jo********@hotmail.com> wrote in message
> news:ae**************************@posting.google.c om...
> > I am trying to use calculated fields in my query but all the

results > > are zero ven when they're not. Please help. Thanks.

Nov 12 '05 #6

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

Similar topics

3
by: Anonymous | last post by:
Hi all, I have a form people use to enter checking data. One of the fields is calculated based on finding the difference of two input fields on the form. Here are the fields: CheckAmount...
1
by: Miguelito Bain | last post by:
hi everybody. i'm trying to find out what you can and can't do with/in calculated fields. any help, pointers, and/or advice would be greatly appreciated. i'm a newbie, but i want to learn, and...
2
by: david | last post by:
Hi, I have a form with a couple of calculated fields. I want to put some code into the 'Form-Load' event to set various object states on the form, depending on the value of these fields. The...
2
by: Ryker | last post by:
I have a Purchase Order where I have a calculated field called Price that is calculated by multiplying Qty * Sales Price. I have 10 of these fields...Price 1 - Price 10 (for each line of the PO). ...
2
by: Olveres | last post by:
Hi, I have managed to work out how to add new lines into a calculated text box. However in this text box some of the outcome fields are empty however when previewing the report it includes the...
5
by: Henrik | last post by:
The problem is (using MS Access 2003) I am unable to retrieve long strings (255 chars) from calculated fields through a recordset. The data takes the trip in three phases: 1. A custom public...
2
by: jcf378 | last post by:
hi all. I have a form which contains a calculated control ("days") that outputs the # of days between two dates (DateDiff command between the fields and ). However, when I click "Filter by...
3
by: Matthew Wells | last post by:
If I have a calculated field that returns a value from a udf, does that field get calculated even when it's not being used in a Select statement? I knw that if a calculated field's formula is...
2
by: mkbrady | last post by:
I have a query that includes calculated fields that generate numeric results. I have wrapped conversion functions CLng() and CDdl() around the calculated fields to ensure the data types are...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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,...

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.