Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
SQL Combining Field Results
Hi,
use & instead of +. eg. Select field1&field2 from mytable arno |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
combining two spreadsheets with a common field | Excel Discussion (Misc queries) | |||
Combining date to one cell with uniform results | Excel Discussion (Misc queries) | |||
Combining workbooks with some variable field names | Excel Discussion (Misc queries) | |||
Combining formulas and results HELP!! | New Users to Excel | |||
Vlookup multiple results in one field??? | Excel Programming |