extract partial information

J

JOM

I have an Itemfield in my Itemtable, what I would like to do is extract some
information from that Itemfield and put in a different table as follows

itemfield example = DOC51110 , DFM51111, DOC5113, FSP51110, FSS51111 etc

I would like to extract the first 3 left characters and put that information
in tblItemDesc.LogCode
I would like to extrat the 4 right characters and put that information in
the tblItemDesc.ProductCode

Log Cod Product Code
DOC 1110
DFM 1111
DOC 5113
FSP 1110
FSS 1111
 
J

JOM

Thanks, but how am I going to put that informaion into a different table? and
what if for example I have the first 3 as DOC123 how will this be taken care
of?

RobFMS said:
Use the Left() and Right() functions.

Left ("DOC51110",3) --> "DOC"

Right("DOC51110",4) --> "1110"

You could use these in a query too.

(example)
Select Left(ItemField,3) as [Log Cod], Right(ItemField,4) as [Product Code]
From Table1

HTH

Rob Mastrostefano

--
FMS Professional Solutions Group
http://www.fmsinc.com/consulting

Software Tools for .NET, SQL Server, Visual Basic & Access
http://www.fmsinc.com

FMS Advanced Systems Group
http://www.fmsasg.com/


JOM said:
I have an Itemfield in my Itemtable, what I would like to do is extract
some
information from that Itemfield and put in a different table as follows

itemfield example = DOC51110 , DFM51111, DOC5113, FSP51110, FSS51111 etc

I would like to extract the first 3 left characters and put that
information
in tblItemDesc.LogCode
I would like to extrat the 4 right characters and put that information in
the tblItemDesc.ProductCode

Log Cod Product Code
DOC 1110
DFM 1111
DOC 5113
FSP 1110
FSS 1111
 
O

Ofer

Instead of the right(FieldName,3) I would use Mid(FieldName,4) that way it
will take how many digits there are after the three text chr.


--
I hope that helped
Good Luck


JOM said:
Thanks, but how am I going to put that informaion into a different table? and
what if for example I have the first 3 as DOC123 how will this be taken care
of?

RobFMS said:
Use the Left() and Right() functions.

Left ("DOC51110",3) --> "DOC"

Right("DOC51110",4) --> "1110"

You could use these in a query too.

(example)
Select Left(ItemField,3) as [Log Cod], Right(ItemField,4) as [Product Code]
From Table1

HTH

Rob Mastrostefano

--
FMS Professional Solutions Group
http://www.fmsinc.com/consulting

Software Tools for .NET, SQL Server, Visual Basic & Access
http://www.fmsinc.com

FMS Advanced Systems Group
http://www.fmsasg.com/


JOM said:
I have an Itemfield in my Itemtable, what I would like to do is extract
some
information from that Itemfield and put in a different table as follows

itemfield example = DOC51110 , DFM51111, DOC5113, FSP51110, FSS51111 etc

I would like to extract the first 3 left characters and put that
information
in tblItemDesc.LogCode
I would like to extrat the 4 right characters and put that information in
the tblItemDesc.ProductCode

Log Cod Product Code
DOC 1110
DFM 1111
DOC 5113
FSP 1110
FSS 1111
 
O

Ofer

Ignore my post for now
You asked what will happen if you have DOC123, what do you want to happen
with this?
DOC and 123
or
DOC and 23 ignore the 1 like you ignore the 5 in your example



Ofer said:
Instead of the right(FieldName,3) I would use Mid(FieldName,4) that way it
will take how many digits there are after the three text chr.


--
I hope that helped
Good Luck


JOM said:
Thanks, but how am I going to put that informaion into a different table? and
what if for example I have the first 3 as DOC123 how will this be taken care
of?

RobFMS said:
Use the Left() and Right() functions.

Left ("DOC51110",3) --> "DOC"

Right("DOC51110",4) --> "1110"

You could use these in a query too.

(example)
Select Left(ItemField,3) as [Log Cod], Right(ItemField,4) as [Product Code]
From Table1

HTH

Rob Mastrostefano

--
FMS Professional Solutions Group
http://www.fmsinc.com/consulting

Software Tools for .NET, SQL Server, Visual Basic & Access
http://www.fmsinc.com

FMS Advanced Systems Group
http://www.fmsasg.com/


I have an Itemfield in my Itemtable, what I would like to do is extract
some
information from that Itemfield and put in a different table as follows

itemfield example = DOC51110 , DFM51111, DOC5113, FSP51110, FSS51111 etc

I would like to extract the first 3 left characters and put that
information
in tblItemDesc.LogCode
I would like to extrat the 4 right characters and put that information in
the tblItemDesc.ProductCode

Log Cod Product Code
DOC 1110
DFM 1111
DOC 5113
FSP 1110
FSS 1111
 
Top