Here's what I would do:
Make sure that the table has a primary key field. If not add an autonumber
field.
Export the data as a text file. I'd create a query that has the PK and the
field in question joined together like below and export it:
TheField: [PK] & "^" & [TheField]
Reimport the text field as its own table. When the Import Wizard gets to
Delimited or Fixed Width, chose Delimited. Next make the delimiter ^ by
clicking on the Other box and putting ^ in there. For some reason using
Access 2007, I had to bang on the ^ key a few times before it showed up.
Clicking out of the box seemed to help.
Next put in the field names that you want to see such as PK in Field 1,
DOC_CLASS in Field 2, and so on.
Import the data into it's own table.
Run update queries, or just plain old Find and Replace to get rid of
DOC_CLASS=, and so on for each field.
Join this new table with the existing table on the PK fields.
Now you can do nice, conventional queries on your data.
If you import this data frequently, you can set up procedures to do this in
the first place. Or, better yet, contact the people who give you this data in
the first place and have them export it in a better format. You'd be suprised
how often this works once you find the right people and ask, or bribe,
nicely.....
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.
Marc T said:
Hi,
I have a table which contains a long string, and I need to query to get
three pieces of data from within the string as below:
DOC_CLASS=DL^DOC_NO=100102^DOC_REV=E^DOC_SHEET=1^
I need to search the string for the 100102 after DOC_NO, E after DOC_REV and
1 after DOC_SHEET.
Does anyone have any pointers on how to start?
Thanks,
Marc