Results 1 to 2 of 2

Thread: multiply all data in the field

  1. #1
    Join Date
    May 2007
    Posts
    2

    Unhappy multiply all data in the field

    hi there,
    How can we write a query so that all the value in the ‘test’ field will be multiplied to get 1 value at the end. Meaning that 100% * 96.13% * 99.71% * 100% *…* 100% where at the end it will give answers of 3.01% when all the values is been multiplied.

    The results of the query is base on the process.

    test ProcessNumber Process
    11.08% S0620 SR113
    36.38% S0660 SR113
    87.60% S0637 SR113
    94.02% S0760 SR113
    94.54% S0265 SR113
    96.13% S0095B SR113
    99.71% S0098A SR113
    100.00% S0091 SR113
    100.00% S0108A SR113
    100.00% S0660A SR113
    100.00% S0760A SR113

    thanks in advance....

  2. #2
    Join Date
    Oct 2006
    Location
    Maitland NSW Australia
    Posts
    275

    Multiply all data in the field

    I will make the assumption that the number of entries for each process is dynamic meaning there could be 5 or 50 etc.Using this assumption one method would be to store the data range, using your example, of all the Process Numbers for Process SR113 in a table, then use some coding to step through the records to give an answer.

    The coding process would be store the test value for record 1 as record_test and store that as a variable called temp_result move to record 2 get the value for test in test2, store it as record_test then temp_result=record_test*temp_result then continue through the records giving the final result as temp_result.

    Let me know if require more information etc.
    Allan

Posting Permissions

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