SQL Combining Field Results

E

ell

Hi all,

Please forgive me if this is really easy, but I'm from a 4G
background, and not too familar with pure SQL statements.

What I am trying to do is quite simple.

I have two text fields in a record, which I wish to merge at point o
extraction. Ie:

SELECT item-no, desc1, desc2 FROM mytable WHERE mytable.item-no
"MyItem"

To merge the description fields I have tried (for instance):

SELECT desc1 + desc2

But Microsoft Query expects the values as number data.

So I tried:

SELECT desc1 & desc2

and various other permutations, but still have no luck.

Can anyone point me in the right direction please?

Thanks in advance.

El
 
E

Ell

Jamie Collins said:
ell wrote ...
To merge the description fields I have tried (for instance):

SELECT desc1 + desc2

But Microsoft Query expects the values as number data.

So I tried:

SELECT desc1 & desc2

and various other permutations, but still have no luck.

Rather than MS Query make the rules, it will be your provider. For
examle, the following works for me when the source is Excel because I
*know* the Jet provider supports the syntax:

SELECT Col1 & Col2 FROM [General$];

What DBMS (data source and provider) are you using?

Jamie.

Hi all and thank you very much for your replies so far.

I'm sure I've tried using + and & in various ways, but it seems to throw it
back at me. Both columns are character(30). Nevertheless, I will retry them
as demonstrated by you kind people when I get back into the office tomorrow.

I am querying a SCULPTOR database on a Linux Redhat server, using Transoft
USQL middleware (server and clientside), under Microsoft Excel 2000 Query.

Does Microsoft Query allow full SQL statements and its complete syntax, or
is it known to fail if it can't generate a nice graphical view of your
personalised SQL query?

Thanks again.

Elliot
 
J

Jamie Collins

Ell said:
I am querying a SCULPTOR database on a Linux Redhat server, using Transoft
USQL middleware (server and clientside), under Microsoft Excel 2000 Query.

Does Microsoft Query allow full SQL statements and its complete syntax, or
is it known to fail if it can't generate a nice graphical view of your
personalised SQL query?

The wizard seems to write its own version of SQL, which looks awful,
is hard to edit manually and has limitation on OUTER JOINs, alias,
etc. If it can't represent grpahically it tells you but doesn't *fail*
for this reason alone.

If you write your own SQL directly in its SQL window, it is passed to
the provider unamended and executed on the server. I know which one I
prefer...

Jamie.

--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top