Reply to Re: How do I concatenate text to a sql statement

Your name:

Reply:


Posted by David Portas on 10/20/05 23:18

SQL delimits string literals with single quotes rather than double:

SELECT IdFlight, OrganizerLastName + ', ' + OrganizerFirstName +
'Flt:' + FlightNumber AS Concat
FROM TableFlights
ORDER BY OrganizerLastName, OrganizerFirstName ;

--
David Portas
SQL Server MVP
--

"COHENMARVIN" <cohenmarvin@hotmail.com> wrote in message
news:1129835952.069950.284810@z14g2000cwz.googlegroups.com...
> The following sql statement fails:
> SELECT IdFlight, OrganizerLastName + ", " + OrganizerFirstName + "
> Flt:" + FlightNumber As Concat FROM TableFlights Order By
> OrganizerLastName, OrganizerFirstName
> I'm trying to concatenate fields and words, but my asp.net page gives
> me an error saying " Flt:" is not a field.
> Thanks,
> Marvin
>

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация