473,466 Members | 1,301 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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

Oct 20 '05 #1
1 47041
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: gwarning! | last post by:
Goal: Have multiple text files, each of various lengths, be concatenated together into one final consolidated text file. Problem: Since the names of the files to be concatenated can change from...
8
by: Dixie | last post by:
I have the results of a query to send to a mailmerge with Word 2000. The query produces say 6 to 8 records, where only 1 of the fields is different from record to record. I can only have one...
3
by: PC Datasheet | last post by:
I have three lines of text I need to concatenate into one "paragraph". The "paragraph" need to look like: Text1 Text2 Text3 where the lines of text are stacked in the "paragraph". When I use...
3
by: Mike Moore | last post by:
Is there an easy way to concatenate two columns (i.e. last name and first name columns) in a data set so both can show up in a data text field of a combo box?
3
by: jgscott3 | last post by:
All, I have the following expression in a query: Switch(>=10121 And <=10135,&"xxx") (There are other expresions within Switch, but this is the one in question.) I need to evaluate as a...
4
by: Dan | last post by:
Hi all, I am creating a search table where the keywords field is made up of several text fields and this is causing me some problems. I can concatentate the text ok but i can't seem to concatenate...
13
by: sinbad | last post by:
hi, how to concatenate a "hash defined" constant value to another "hash defined" constant string. For example #define ABC 100 #define MYSTR "The value of ABC is" Now i need a string that...
10
by: Aaron Hoffman | last post by:
Hello, I'm hoping someone might be able to offer some guidance to my problem. I have one query in MS Access which consists of 2 tables joined by a SEQUENCE_ID. By joining the two tables I am...
6
by: mark83anthony | last post by:
How do I concatenate strings from a column into a single row? Whats the logic to create the function in DB2. Given is below. Color ------ red orange
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.