Parsing the table field

Abg

Registered User.
Local time
Today, 07:55
Joined
Jan 23, 2010
Messages
32
I am new user. Is it possible to parse one of the field in the table and move the parsed data into other two field of the same table?
For example, I have data PKY87987aa-012334 in the first field. PKY87987aa will go into second field of the same table and 012334 will go to the third field of the same table.
Is it possible? If yes, how can we do it?
Thanks
 
You can use an update query, and depending on the consistency of the data, the appropriate string function(s): Left(), Right(), Mid(), InStr(), etc. More info in Help.
 
Thanks Paul.
The format of tha data in the first field is consistent.
The format is PKYxxxxaa-yyyyyyyy , where x,y= numbers.

--Ash
 
That makes it easier. Check out the functions and post back if you get stuck.
 
Just to mention something that wasn't mentioned -

I hope that if you are doing this in the table that you are NOT keeping the first column once you have done this. If you are planning on keeping that column, then you shouldn't be adding these other two columns and instead use a query to have them available.
 
Hi Paul,
I have designed an update query as you suggested but getting an error of non updating all record. I attached a pdf file of Query grid
 

Attachments

Hi Paul,
I have designed an update query as you suggested but getting an error of non updating all record. I attached a pdf file of Query grid


Go to the sql view, and paste the sql string here
 
Here is the SQL:

UPDATE SNEntry SET SNEntry.ScanSerialNumber = "ScanSerialNumber", SNEntry.Tanapa = Left([ScanSerialNumber],9), SNEntry.[Serial Number] = Right([ScanSerialNumber],9);
 
I don't think you want to update the original column.
 
Paul,
It worked fine after I removed original column from the Query grid. Thank you for help.

Ash
 
No problem, and welcome to the site by the way!
 
Now, what you did seems to work for you, but may I offer an observation and suggestion that is probably safer?

Never do parsing in-place on a table you intended to keep. Make a temporary table or two or six (however many you need), then run your query on the temps until you have it right. Then run the final version of your query, delete the original table, rename the temp as a replacement for the original table. In the process, if you broke apart one long field into two or more fields, the final table should not include a copy of the original table - because it already does. You can use a query with string concatenation to make a "view" of what that original field looks like. But rather obviously, it was important for you to have the field split into its pieces-parts.

Here's a rule of thumb. The final table should be in the format that you need most often. Use queries to "convert" it into other formats when you need them. That includes re-merging fields that sometimes need to be together.
 
I am new user. Is it possible to parse one of the field in the table and move the parsed data into other two field of the same table?
For example, I have data PKY87987aa-012334 in the first field. PKY87987aa will go into second field of the same table and 012334 will go to the third field of the same table.
Is it possible? If yes, how can we do it?
Thanks
you can use update query with mid function.for further details contact chundusmgs@rediffmail.com
 

Users who are viewing this thread

Back
Top Bottom