Link to home
Start Free TrialLog in
Avatar of Gabriel_Brienza
Gabriel_Brienza

asked on

Problem concatenating a string

what i need to do is that when I loop through a recordset i get some ids.
These Ids are in a lump (Start and end)

For each lump(eg numberC_Start and numberC_END )I need to get all the number from start to end
and concatanate it in a string .

How can I do it?


Code:
dim numberA_Start as long
dim numberB_Start as long
dim numberC_Start as long

dim numberA_END as long
dim numberB_END as long
dim numberC_END as long


numberA_Start =5
numberA_END =5

numberB_Start =66
numberB_END =69

numberC_Start =91
numberC_END =95


dim strResult as string

strResult=5/66/67/68/69/91/92/93/94/95/



EG of a loop

Dim tempFirstNumber as long,tempLastNumber as long,tempStrResult as string
dim rs as adodb.Recorset,Delimiter as string

set Delimiter="/"
set rs=GetStuff......

   do while not rs.eof
      tempFirstNumber =rs.fields("FirstNum").value
       tempLastNumber =rs.fields("LastNum").value
     'HELP
      '//calcuLate all the numbers within first and last and concatanate in a string


      rs.movenext
   loop
   tempStrResult

 

Thanks a lot in advance
SOLUTION
Avatar of g_johnson
g_johnson
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Gabriel_Brienza
Gabriel_Brienza

ASKER

thanks guys
that both worked and I didnt know who to assign the answer to.I decide to split .
Hope its fair

Thanks for your great and quick answer.