Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2002
    Posts
    11

    Unanswered: Calculate a number field?

    I use a 6 year old program that uses Access 97 databases. I also have Access 97 and a beginners knowledge of how to use it. I want to add a number field (I know how) and use the number entered in this new field to calculate the number in another field (I do not know how).

    The fields are; Code (the key, text), Order (number), and the new field will be Quantity (number).

    The Quantity field will contain from zero up to 36. If the number entered in Order is 12 and the number in Quantity is zero then Order will stay zero. But if the number entered in Order is 12 and the number in Quantity is 12 then Order will become one. If the number in Order is 12 and the number in Quantity is 6 then Order will become 2. The formula would be; Order divided by Quantity.

    I would appreciate any help.

  2. #2
    Join Date
    Sep 2003
    Location
    T.O.
    Posts
    326
    Sounds to me like you need a query:

    SELECT CODE, ORDER, QUANTITY,
    iif(QUANTITY=0,0,ORDER/QUANTITY ) AS Whatever
    FROM YourTable
    All code ADO/ADOX unless otherwise specified.
    Mike.

  3. #3
    Join Date
    Dec 2002
    Posts
    11

    A calculated field

    Thanks for responding. I need the new field to recalculate the Order field number. Not having this feature is causing errors that have to be corrected manually, the company that made this program did not think of this.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •