Welcome to WebmasterWorld Guest from 220.127.116.11
Forum Moderators: open
Table name: custbranch
I have it set up like this so far:
brname would be "John Smith"
braddress1 would be "123 Main Street"
braddress2 would be "Unit 45"
braddress3 would be "Anytown"
braddress4 would be "State"
braddress5 would be "Zip"
braddress6 would be "Country"
I need to move braddress2 info to after braddress1 so braddress1 would read "123 Main Street, Unit 45" with the comma added between.
I don't have braddress2 filled in for everybody, so I don't want commas that aren't needed, just for if there is info in braddress2 to move. Then I need braddress2 cleared and braddress3 moved to braddress2 spot. Then braddress3 cleared and info from braddress4 moved to braddress3. Then braddress4 cleared and info from braddress5 moved to braddress4. Then braddress5 cleared.
I have 3 tables with this sort of user input error that I need to correct.
To combine line1 & line 2, you would simply concatenate these values together after the SELECT statement, then UPDATE the new line1 back to the db.
Something like (pseudo code):
WHILE counter < Results in db
line1 = braddress1 result from db
line2 = braddress2 result from db
line3 = "
line4 = "
line5 = "
newline1 = line1
if (line2 not equal to "")
newline1 = newline1 & ", " & line2