Results 1 to 5 of 5
  1. #1
    Dankurkos is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2013
    Posts
    2

    making the formula expression to sum ​​a series of numbers (text) numerical result

    Hi ...

    I will make a query, but I have difficulty in making the formula expression to sum ​​a series of numbers (text) into the numerical results
    example


    NUMBER_BA GOODS_KODE QTY_GOODS TOTAL
    001 1 +8000+800+9000 formula sum a series of numbers (text) into the numerical results


    = 17.800
    001 1 +8000+800+9000
    001 1 +8000+800+9000
    001 2 +500+1500+10000+15000+14000 41.000
    001 2 +500+1500+10000+15000+14000



    anybody can help me
    I attached an example file database query

    Thank you

    Click image for larger version. 

Name:	Untitled-11.jpg 
Views:	14 
Size:	145.2 KB 
ID:	14426

  2. #2
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    It looks like "QTY_GOODS" is a MVF... I don't use multi value fields - they are not easy to deal with and are not (IMO) a normalized structure.


    You could write your own function (UDF) to return a value.

    - Pass the field "QTY_GOODS" value to the function
    - Split the field on the *+ sign.
    - Use the Val() function to convert the string to a value and add the values.
    - Return the sum.



    But the first thing I would do is stop using the MVF...

  3. #3
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    I agree, multi-value fields bad.

    Steve, if that is truly a multi-value field (not a single string) then don't think parsing will work.

    If you must use MVF, then do a query that expands the multi-value field then do an aggregate query on the records or build a report and do aggregate calcs in footer sections

    http://office.microsoft.com/en-us/ac...010149297.aspx

    Should have set the field as number type, not text. Will have to deal with eliminating the + sign and converting to a number in the expanded query, Val() function works:

    Val([field])

    However, if those values were one long string instead of multi-value, could use Eval() function.
    Last edited by June7; 11-19-2013 at 01:18 PM.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  4. #4
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    if that is truly a multi-value field (not a single string) then don't think parsing will work.
    Yes, you are right. It was a long day.... thanks

  5. #5
    Dankurkos is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2013
    Posts
    2
    yeahh,,it work
    I use a formula eval ([field])

    thank you

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Error Message Result In Count Formula
    By EHittner in forum Forms
    Replies: 4
    Last Post: 10-22-2013, 10:52 AM
  2. Replies: 5
    Last Post: 09-25-2013, 09:35 AM
  3. making an array out of a query result
    By Richie27 in forum Programming
    Replies: 4
    Last Post: 05-01-2012, 01:53 PM
  4. Query Numerical and Text
    By Athyne in forum Queries
    Replies: 1
    Last Post: 01-14-2012, 12:07 AM
  5. Making New Record Number Next Numerical Number
    By jhillbrown in forum Access
    Replies: 1
    Last Post: 03-10-2010, 11:06 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums