Drop Table

Support Forum for database administrators and web based access to important newsgroups related to databases
Register on Database Support Forum Edit your profileCalendarFind other Database Support forum membersFrequently Asked QuestionsSearch this forum -> 
For Database admins: Free Database-related Magazines Now Free shipping to Texas


Post New Thread










Thread
Author

How do I concatenate text to a sql statement
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


Report this thread to moderator Post Follow-up to this message
Old Post
COHENMARVIN
10-27-05 02:25 PM


Re: How do I concatenate text to a sql statement
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
>



Report this thread to moderator Post Follow-up to this message
Old Post
David Portas
10-27-05 02:25 PM


Sponsored Links





Last Thread Next Thread
Post New Thread

Microsoft SQL Server forum archive

Show a Printable Version Email This Page to Someone! Receive updates to this thread
Microsoft SQL Server
Access database support
PostgreSQL Replication
SQL Server ODBC
FoxPro Support
PostgreSQL pgAdmin
SQL Server Clustering
MySQL ODBC
Web Applications with dBASE
SQL Server CE
MySQL++
Sybase Database Support
MS SQL Full Text Search
PostgreSQL Administration
SQL Anywhere support
DB2 UDB Database
Paradox Database Support
Filemaker Database
Berkley DB
SQL 2000/2000i database
ASE Database
Forum Jump:
All times are GMT. The time now is 03:20 PM.

 
Mobile devices forum | Database support forum archive




Copyrights DropTable.com Database Support Forum 2004 - 2006