|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
SQL syntax questionIn SQL how do you combine several fields AS 'xxxxx'.
This type of syntax doesn't work SELECT MyPhone & "-" & MyCity AS 'MyInfo' FROM XXXXX WHERE.... + 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.... > 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.... > > > 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.... >> >> >> 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.... > |
|||||||||||||||||||||||