Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
ell ell is offline
external usenet poster
 
Posts: 1
Default SQL Combining Field Results

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

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 184
Default SQL Combining Field Results

Hi,

use & instead of +.

eg. Select field1&field2 from mytable

arno


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 593
Default SQL Combining Field Results

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.

--
  #4   Report Post  
Posted to microsoft.public.excel.programming
Ell Ell is offline
external usenet poster
 
Posts: 1
Default SQL Combining Field Results


"Jamie Collins" wrote in message
om...
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


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 593
Default SQL Combining Field Results

"Ell" wrote ...

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.

--
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
combining two spreadsheets with a common field MAD101 Excel Discussion (Misc queries) 1 October 21st 08 02:04 AM
Combining date to one cell with uniform results Gail Excel Discussion (Misc queries) 3 May 29th 08 08:58 PM
Combining workbooks with some variable field names Bob Dobalina Excel Discussion (Misc queries) 8 May 17th 05 09:48 PM
Combining formulas and results HELP!! JRH New Users to Excel 4 January 22nd 05 05:26 PM
Vlookup multiple results in one field??? Jeremy Reynolds Excel Programming 1 October 1st 03 12:46 AM


All times are GMT +1. The time now is 12:01 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"