Page 1 of 1

Renaming table columns

Posted: Thu Jul 11, 2019 12:36 am
by Tarak
Hi,

When I preview my form, the table columns are a lot wider than they need to be because of the column name, is it possible to rename the column names in an SQL connection?
This is part of the SQL code:
SELECT [jmpJobID], [jmpPartID], [jmpPartShortDescription]

I thought I could use something like the following, but it doesn't accept it.

SELECT [jmpJobID] as "Job ID", [jmpPartID] as "Part ID", [jmpPartShortDescription] as "Description"

:D

Re: Renaming table columns

Posted: Thu Jul 11, 2019 1:40 pm
by Kyleodonnell
Tarak,

You can use aliases in the data connection
aliases.PNG
aliases.PNG (31.27 KiB) Viewed 409 times
this will allow you to name the field whatever you wish.

Re: Renaming table columns

Posted: Fri Jul 12, 2019 9:14 pm
by Tarak
Hi Kyle,

Thanks for the response, I tried the Alias field, but that only seems to rename the field in the tree, the column name in the table still remains the name that is pulled from SQL. :-k

Re: Renaming table columns

Posted: Fri Jul 12, 2019 10:52 pm
by Kyleodonnell
Tarak,

can you attach a screenshot what your table columns look like?

Re: Renaming table columns

Posted: Fri Jul 12, 2019 11:03 pm
by Tarak
Hi Kyle,

No worries.

Re: Renaming table columns

Posted: Mon Jul 15, 2019 1:47 pm
by Kyleodonnell
Tarak,

As you are using a label, you cannot rename the columns of the data initialization object that you select records from. However, if you use powerforms, you can use a table object which allows you to rename the columns. What version of the software are you currently using? Please go to help>about in the software.

Re: Renaming table columns

Posted: Thu Jul 18, 2019 6:34 am
by Tarak
Hi Kyle,

Thanks again for all your help, I managed to figure it out, I killed 2 birds with one stone, I managed to rename the columns and trim the values using the following SQL commands:

RTRIM([jmpJobID]) as "Job ID", RTRIM([jmpPartID]) as "Part ID"

Thanks again :D