By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,474 Members | 1,343 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,474 IT Pros & Developers. It's quick & easy.

How do I concatenate text to a sql statement

P: n/a
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

Oct 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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" <co*********@hotmail.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.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

Oct 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.