String=1000;2000;3000;4000 how can i add this nos? i need this total = 1000+2000+3000+4000=10000
B billypit786 Mar 28, 2008 #1 String=1000;2000;3000;4000 how can i add this nos? i need this total = 1000+2000+3000+4000=10000
L Linq Adams via AccessMonster.com Mar 28, 2008 #2 As answered in TheScripts.com: Assuming you have the Split() function available (I think it started with version 2000) YourString ="1000;2000;3000;4000" Nos = Split(YourString,";",-1) YourTotal = val(Nos(0)) + val(Nos(1)) + Val(Nos(2)) + val(Nos(3))
As answered in TheScripts.com: Assuming you have the Split() function available (I think it started with version 2000) YourString ="1000;2000;3000;4000" Nos = Split(YourString,";",-1) YourTotal = val(Nos(0)) + val(Nos(1)) + Val(Nos(2)) + val(Nos(3))
D Douglas J. Steele Mar 28, 2008 #3 There's a simpler way: YourString ="1000;2000;3000;4000" YourTotal = Eval(Replace(YourString, ";", "+"))
There's a simpler way: YourString ="1000;2000;3000;4000" YourTotal = Eval(Replace(YourString, ";", "+"))