Basic math

S

Scott

This query was working fine until I configured the QTYPER field as a number
(type Single). Now I am getting a data type mismatch.

UPDATE [PARTMTL - FINAL] SET [PARTMTL - FINAL].QtyPer = [PARTMTL -
FINAL]![QtyPer]/1.3
WHERE ((([PARTMTL - FINAL].estscrap)="15"));

Basicly the only thing i need to do is find all the records in [PARTMTL -
FINAL] table that have a ESTSCRAP factgor of "15" then divide the existing
QTYPER by 1.15.
 
J

John W. Vinson

This query was working fine until I configured the QTYPER field as a number
(type Single). Now I am getting a data type mismatch.

UPDATE [PARTMTL - FINAL] SET [PARTMTL - FINAL].QtyPer = [PARTMTL -
FINAL]![QtyPer]/1.3
WHERE ((([PARTMTL - FINAL].estscrap)="15"));

Basicly the only thing i need to do is find all the records in [PARTMTL -
FINAL] table that have a ESTSCRAP factgor of "15" then divide the existing
QTYPER by 1.15.

This query implies that the datatype of estscrap is Text (since you're using
quotemarks). If estscrap is a Number field, lose the quotes.

I have no idea how the 1.3 in the query as written relates to the 1.15, nor
how the QtyPer field relates to the QTYPER field. Your description does not
seem to bear any relation to the query as written!
 
S

Scott

Both fields started out as text. I have since turned them in to
number/single.

As a side note i figured out that the calculation was right. It's just
displaying scientific notation.

I am still trying to figure out how to get the format correct and how to get
the calc to work.
 
J

John W. Vinson

Both fields started out as text. I have since turned them in to
number/single.

As a side note i figured out that the calculation was right. It's just
displaying scientific notation.

That often happens if the textbox in which you are displaying it is a bit too
small. If it can't display 31225.005 it will try to display 3.12E4 for
example. Does it help to use a larger textbox? or use Round() to round the
quotient to one or two decimals?
I am still trying to figure out how to get the format correct and how to get
the calc to work.

It would help a lot if you would post the actual problem you're trying to
solve, with enough context (e.g. field types) that someone might be able to
help.
 
S

Scott

The problem causing the data type mismatch was the "15". this was left over
from when the ESTSCAP filed was a text field. I also had to format the table
containing the results as standard,single,fixed,5.

Then everything worked as advertised.
 
L

Lord Kelvan

well if ESTSCAP is a number then remove the double quotes

UPDATE [PARTMTL - FINAL] SET [PARTMTL - FINAL].QtyPer = [PARTMTL -
FINAL]![QtyPer]/1.3
WHERE ((([PARTMTL - FINAL].estscrap)=15));

you only use double quotes to note text in a text field no quotes for
numbers

Regards
Kelvan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top