473,322 Members | 1,409 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Combining two fields

i want to combine two fields and have used the the following query
Expand|Select|Wrap|Line Numbers
  1. UPDATE SudentInfo SET 
  2. image1name = CONCAT(imagepath,UserName,'1');
this works but the thing is when a new record is added the query is not applied and i have to manually execute the query again.

Is there a way to automate this so that the query is applied to all subsequent records?
Cheers
Oct 3 '08 #1
5 2027
Atli
5,058 Expert 4TB
Hi.

Why do you want to duplicate your data like that?

It would make much more sense to combine the fields when the data is read, rather then storing duplicates of data that already exists.

However, if you want to do it this way, you could look into Triggers.
Oct 3 '08 #2
Ya, u can use trigers for updating columns or the other way is to concatenate columns while fetching records.
Oct 6 '08 #3
I needed to combine two fields into one, so i executed this query

UPDATE Students SET
image1 = CONCAT(imagepath, image1name);

This worked, but the problem is that whenever a new record is added i have to manually re-enter and execute the query, is there any way to achieve the same outcome (image1 = imagepath+image1name) for all subsequent records that would be entered, without me having to do it manually?
Oct 6 '08 #4
ak1dnar
1,584 Expert 1GB
are you using this query in a application or how you going to get those two values to that query? is it a user input? be more specific with your question.
Oct 6 '08 #5
Atli
5,058 Expert 4TB
lmeeson.

Do NOT double post your questions!
This only serves to cause confusion and is highly disrespectful of those of us that have taken the time to answer your first post.

Please read and follow the Posting Guidelines when posting in these forums, or risk getting your account banned.

I have merged your new thread into this one.
If the answers we provided do not work for you, explain why and we may be able to provide alternate solutions.

Also, please use [code] tags when posting code examples.
This makes them easier to read and thus, makes it easier for us to help you.

Thank you
Moderator
Oct 7 '08 #6

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

Similar topics

8
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
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
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
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
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
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
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
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
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
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
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.