add numbers in string

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • billa856
    New Member
    • Nov 2007
    • 101

    add numbers in string

    String=1000;200 0;3000;4000

    how can i add this nos?

    i need this
    total = 1000+2000+3000+ 4000=10000
  • missinglinq
    Recognized Expert Specialist
    • Nov 2006
    • 3533

    #2
    Assuming you have the Split() function available (I think it started with version 2000)

    Code:
    YourString ="1000;2000;3000;4000"
    Nos = Split(YourString,";",-1)
    YourTotal = val(Nos(0)) + val(Nos(1)) + Val(Nos(2)) + val(Nos(3))
    Linq ;0)>

    Comment

    • billa856
      New Member
      • Nov 2007
      • 101

      #3
      I found this one and its simple

      Total = Eval(Replace(St ringName, ";", "+"))

      Comment

      • missinglinq
        Recognized Expert Specialist
        • Nov 2006
        • 3533

        #4
        Even better! Doug Steele is a slick fellow!

        Linq ;0)>

        Comment

        Working...