Parsing

  • Thread starter Thread starter Michaelcip
  • Start date Start date
M

Michaelcip

Thanks in advance...
I'm trying to parse the following field (Machine) to eliminate the "-SAP"
How is this done? Many thanks, MC

Machine
DT-1-SAP
EC-1600-SAP
EC-1600-SAP
EC-1600-SAP
EC-1600-SAP
EC-1600-SAP
EC-1600YZT-SAP
EC-2000-SAP
 
Thanks in advance...
I'm trying to parse the following field (Machine) to eliminate the "-SAP"
How is this done? Many thanks, MC

Machine
DT-1-SAP
EC-1600-SAP
EC-1600-SAP
EC-1600-SAP
EC-1600-SAP
EC-1600-SAP
EC-1600YZT-SAP
EC-2000-SAP

What's the context, MC? Are you trying to permanently remove the -SAP suffix
from all records? display the field without the suffix? search the field
ignoring the suffix?

More info please!
 
Michaelcip said:
I'm trying to parse the following field (Machine) to eliminate the "-SAP"
How is this done? Many thanks, MC

Machine
DT-1-SAP
EC-1600-SAP
EC-1600-SAP
EC-1600-SAP
EC-1600-SAP
EC-1600-SAP
EC-1600YZT-SAP
EC-2000-SAP


If the -SAP is guaranteed to always be there:

Left(Machine, Len(Machine) - 4)

But if it might not be there in some records and the field
might be Null sometimes, it can get messy:

IIf(Machine Is Null, Null, IIf(Machine Like "*-SAP",
Left(Machine, Len(Machine) - 4), Machine)
 
Try:

replace(machine,"-sap","")

If you assume that the string "-sap" can occur only at the end and
not internally, that would work. Otherwise, not so much!
 
Is it possible to copy data from a table to a database.

tia

Pete

Your terms don't make sense in the Access universe. A "Database" in Access - a
..mdb or .accdb file - is a container for multiple tables, forms, queries,
reports and other objects. You can import a table from one database into
another database, but as written the question sort of resembles "can I turn a
car into a garage".

Could you explain the context, what you have, and what you are trying to
accomplish?
 
Pete said:
Is it possible to copy data from a table to a database.

A table is part of a database. In fact, a database cosists
of a collection of tables and querys. Everything else is
part of one or more applications that use the data in the
tables by using queries to retieve the desired records.

Would you like to rephrase your question so we can
understand what you are trying to do? At this point, you
question sort of implies that you want to copy a table from
one database to another (easy) or you want to copy something
called a table from some other program (e.g. Word) to an
Access table.

OTOH, having the same data in more than one place is
problematic so copying a table is seriously frowned upon.
 
Thanks guys. I was able to figure it out via parsing. But this "Replace"
method was interesting alternative that I'll tuck away for future use. Have
a great one, MC
 
Back
Top