473,508 Members | 2,247 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Combining 2 fields

2 New Member
Hello,

I'm studying the basics of SQL.
Currently I'm using Northwind to experiment with SQL statements..
I ran into a problem..

Imagine:
Tablename: 'Employees'
Columnnames: 'FirstName, LastName'.

I want to show all the columns (Firstname, LastName) and add a third column called 'Code' (which consists of the first 3 chars of Firstname, and First 3 cahrs of Lastname)

Already tried some things with CONCAT (Access doesn't recognize the statement!?) and LEFT (Already know that I can combine 2 fields with "&")..

I'd really appreciate any help!
Sep 20 '07 #1
3 1473
ADezii
8,834 Recognized Expert Expert
Hello,

I'm studying the basics of SQL.
Currently I'm using Northwind to experiment with SQL statements..
I ran into a problem..

Imagine:
Tablename: 'Employees'
Columnnames: 'FirstName, LastName'.

I want to show all the columns (Firstname, LastName) and add a third column called 'Code' (which consists of the first 3 chars of Firstname, and First 3 cahrs of Lastname)

Already tried some things with CONCAT (Access doesn't recognize the statement!?) and LEFT (Already know that I can combine 2 fields with "&")..

I'd really appreciate any help!
Expand|Select|Wrap|Line Numbers
  1. SELECT FirstName, LastName, Left$([FirstName],3) & Left$([LastName],3) AS Code
  2. FROM tblEmployee;
Sep 20 '07 #2
Dracozan
2 New Member
Thanks for your help, problem solved!
Sep 20 '07 #3
ADezii
8,834 Recognized Expert Expert
Thanks for your help, problem solved!
You are quite welcome.
Sep 20 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

8
8338
by: Ilan | last post by:
Hi all I need to add data from two Excel sheets (both on the same workbook) to an existing table in my SQL DB. The problem is that each sheet holds different fields for the same record, though...
2
4696
by: Kristian | last post by:
Hey, I have some problems combining 2 fields in a query. For example: the first field is "1050-04" and the second field is "02". However, when i try to combine these two the zero in the...
5
2096
by: M.Stanley | last post by:
Hi, I'm attempting to create a query that will combine 2 columns of numbers into one. The followng comes from 1 table with 4 fields (A,B,C,D) A B RESULT 700 000 700000 700 001 ...
1
1481
by: Scott | last post by:
This is probably something really easy, Well I hope anyhow. I have three fields used for barcoding, in one table F1, F2 and F3. I want the three fields to be able to be combined to complete an...
4
3118
by: Omey Samaroo | last post by:
Dear Access Gurus, Can anyone provide me with some much needed assistance. I would like to combine the contents of 3 text fields into one field. Can someone provide some code or a method to do...
2
3391
by: Will | last post by:
I have a table, tblManinstructions with fields Code & InstructionID, one Code can have many InstructionID. I also have tblinstructions (fields instructionID & instruction). What I want to do is...
4
3480
by: justin tyme | last post by:
Hello Experts! I would like to combine (which may not be the correct technical term) two text fields from the same table in a query. Specifically, text field A and text field B are both lists of...
2
2538
by: rpeacock | last post by:
I have a function that takes a field with values separated by commas within the field and splits them to multiple rows. Example: Field - Interior Value - abc,def,efg,ghi Output: ID Item 1 ...
10
10574
by: H | last post by:
Hi, I have the following address fields in a table: flat_number house_name_or_number street village postal_town county postcode
3
2821
by: Ken Fine | last post by:
This is a question that someone familiar with ASP.NET and ADO.NET DataSets and DataTables should be able to answer fairly easily. The basic question is how I can efficiently match data from one...
0
7229
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7129
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
7333
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
7398
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...
0
7502
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5637
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4716
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3208
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
428
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.