Just a quick shot. IF ... IF there's only one <period> in field1, the SSUBCD function can see it as the "custom delimiter":

SET VAR vfield_1_entire TEXT = 'Smith a.4503'
SET VAR vfield_1_last4 TEXT = (SSUBCD(.vfield_1_entire,2,'.'))

Result:
SHOW VAR vfield_1_last4 = 4503

The length of the field after the <period> is not an issue, so long as there's only one period, and, the unit number you want is the only item after the period. There are other functions available to help you focus down if these qualifications don't hold up.

Next, if you always use "UNIT", you could modify the above to be:

SET VAR vfield_1_last4 TEXT = ('UNIT' & (SSUBCD(.vfield_1_entire,2,'.')) )

Result:

SHOW VAR vfield_1_last4 = UNIT 4503

"UNIT" might be presented in variable form if there are other descriptors involved e.g. "Floor", "Suite", etc.

Concatentation is a simple matter of throwing them together:

SET VAR vfield_2_raw TEXT = '13566 Jones Road'
SET VAR vfield_2_complete = (.vfield_2_raw & .vfield_1_last4)

SHOW VAR vfield_2_complete = 13566 Jones Road UNIT 4503

Gotta run, sorry to leave you hanging, but someone will pick it up.

Best, Bruce

Bruce A. Chitiea
SafeSectors, Inc.
1142 S Diamond Bar Blvd # 442
Diamond Bar CA 91765-2203

rby...@safesectors.com
(909) 238-9012 m



------ Original Message ------
From "Larry Haas" <larwii...@gmail.com>
To rbase-l@googlegroups.com
Date 4/28/2024 1:56:14 PM
Subject [RBASE-L] - Concatenation in an update statement

Good afternoon everyone:

I am working with Myron at the Sun City West Posse in Sun City West, Arizona. I am trying to update a field in my table using that field and concatenating something to it.

In Excel, it would look like this:

Field 1  Field 2

Smith a.4503  13566 Jones Road  13566 Jones Road UNIT 4503

     concatenate(field 2," UNIT ",right(Field 1),4)
UPDATE tableName
set field2 =  (Code needed here)
Where


I am trying to add the text field 'UNIT' and the last 4 positions of Field 1 to the existing field 2 in the existing table. I couldn't find a concatenation function or a function capable of grabbing the last 4 characters of another field. Is there a way that this is possible?

Thanks,
Larry Haas





--
For group guidelines, visit http://www.rbase.com/support/usersgroup_guidelines.php
---
You received this message because you are subscribed to the Google Groups "RBASE-L" group. To unsubscribe from this group and stop receiving emails from it, send an email to rbase-l+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/rbase-l/CAB3VSUX1V%2BOtARHoaU0o5%2BcHZ0qNw9DmEAc-Nd60wJJ4-iX4Tw%40mail.gmail.com <https://groups.google.com/d/msgid/rbase-l/CAB3VSUX1V%2BOtARHoaU0o5%2BcHZ0qNw9DmEAc-Nd60wJJ4-iX4Tw%40mail.gmail.com?utm_medium=email&utm_source=footer>.

--
For group guidelines, visit 
http://www.rbase.com/support/usersgroup_guidelines.php
--- You received this message because you are subscribed to the Google Groups "RBASE-L" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rbase-l+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rbase-l/em427943d8-8ec8-469b-9626-cc3c2a238f1a%40a5dc929d.com.

Reply via email to