[Solved] Combine first and last name into one field

Creating tables and queries

[Solved] Combine first and last name into one field

Postby RBromer » Fri May 31, 2019 5:31 pm

I would like to create a field in a query that is the first plus last name with no extra spaces between the names. This is the best that I could come up with but it doesn't work.

SELECT "First" AS "First", "Last" AS "Last", "Dinner--Banquet" AS "Dinner", ("Competitor.First" || ' ' || "Competitor.Last" AS "Name" FROM "Competitor"

I am trying to create a report with name and 'dinner', which is the number of dinners ordered. There should be a line for each record on the report.

I previously did this in dBase Plus but I can't load it onto my new computer so I am starting over with OO Base.
Last edited by RBromer on Fri May 31, 2019 6:41 pm, edited 2 times in total.
Ruth Bromer, OpenOffice version 4.1.5, Windows 10
RBromer
 
Posts: 4
Joined: Fri May 31, 2019 3:30 pm

Re: Combine first and last name into one field

Postby FJCC » Fri May 31, 2019 6:24 pm

This works for me to concatenate the two fields NOMBRE and VALOR with no space between them.
Code: Select all   Expand viewCollapse view
SELECT "NOMBRE", "VALOR", "NOMBRE" || "VALOR" AS "BOTH" from "Tabla1"
Windows 10 and Linux Mint, since 2017
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
FJCC
Moderator
 
Posts: 7191
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: Combine first and last name into one field

Postby RBromer » Fri May 31, 2019 6:38 pm

Well, I thought I had tried something like that, but I guess I never saved it and couldn't replicate it. ANyway, thank you. This worked. I even got the space in there. HEre is my command that works.

SELECT "First" AS "First", "Last" AS "Last", "Dinner--Banquet" AS "Dinner", "First" || ' ' || "Last" AS "Name" FROM "Competitor"

Thank you.
Ruth Bromer, OpenOffice version 4.1.5, Windows 10
RBromer
 
Posts: 4
Joined: Fri May 31, 2019 3:30 pm


Return to Tables & Queries

Who is online

Users browsing this forum: No registered users and 2 guests