Home All Groups Group Topic Archive Search About
Author
15 Feb 2006 8:32 PM
VB Programmer
In SQL how do you combine several fields AS 'xxxxx'.

This type of syntax doesn't work
SELECT MyPhone & "-" & MyCity AS 'MyInfo' FROM XXXXX WHERE....

Author
15 Feb 2006 9:19 PM
W.G. Ryan - MVP
+ should work, FirstField + SecondField but depending on the type, you may
need to cast it to a Varchar or respective type.
Show quote
"VB Programmer" <d***@emailme.com> wrote in message
news:eZp6o7mMGHA.1192@TK2MSFTNGP11.phx.gbl...
> In SQL how do you combine several fields AS 'xxxxx'.
>
> This type of syntax doesn't work
> SELECT MyPhone & "-" & MyCity AS 'MyInfo' FROM XXXXX WHERE....
>
Author
15 Feb 2006 9:19 PM
Kerry Moorman
VB Programmer,

SELECT MyPhone + '-' + MyCity AS MyInfo ...

Kerry Moorman


Show quote
"VB Programmer" wrote:

> In SQL how do you combine several fields AS 'xxxxx'.
>
> This type of syntax doesn't work
> SELECT MyPhone & "-" & MyCity AS 'MyInfo' FROM XXXXX WHERE....
>
>
>
Author
16 Feb 2006 3:09 AM
VB Programmer
Thanks y'all!
Show quote
"Kerry Moorman" <KerryMoor***@discussions.microsoft.com> wrote in message
news:9DC2D41E-AC91-4A41-98EF-A3F34001F42C@microsoft.com...
> VB Programmer,
>
> SELECT MyPhone + '-' + MyCity AS MyInfo ...
>
> Kerry Moorman
>
>
> "VB Programmer" wrote:
>
>> In SQL how do you combine several fields AS 'xxxxx'.
>>
>> This type of syntax doesn't work
>> SELECT MyPhone & "-" & MyCity AS 'MyInfo' FROM XXXXX WHERE....
>>
>>
>>
Author
16 Feb 2006 7:51 AM
Cor Ligthert [MVP]
VB Programmer

What should be the result from MyInfo?

Cor

Show quote
"VB Programmer" <d***@emailme.com> schreef in bericht
news:eZp6o7mMGHA.1192@TK2MSFTNGP11.phx.gbl...
> In SQL how do you combine several fields AS 'xxxxx'.
>
> This type of syntax doesn't work
> SELECT MyPhone & "-" & MyCity AS 'MyInfo' FROM XXXXX WHERE....
>
Author
16 Feb 2006 7:53 AM
Cor Ligthert [MVP]
Forget this one, I misreaded something.

Cor

AddThis Social Bookmark Button