Hi Edwin,
I need to copy the first word from an existing field and place it into a
new field. Is there a way to do that autoagically?
Only per macro:
1. Connect to the field in your form.
2. Read value from this field
3. Split content into an array
4. Take first entry of this array and put it to the new field.
But: You won't need the new field if you only want to extract the first
word and won't edit the new field. You could also get the first word by SQL:
SELECT "Sentence", LEFT("Sentence", POSITION(' ' IN "Sentence")) AS
"FirstWord" FROM "Table"
If there is only one word in "Sentence" this word wouldn't be shown. So
the code has to be expanded:
SELECT "Sentence", CASE WHEN POSITION(' ' IN "Sentence") > 0 THEN
LEFT("Sentence", POSITION(' ' IN "Sentence")) ELSE "Sentence" END AS
"FirstWord" FROM "Table"
Regards
Robert
--
Homepage: https://www.familiegrosskopf.de/robert
--
To unsubscribe e-mail to: [email protected]
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy