Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Truncation

Status
Not open for further replies.

Leo1278

IS-IT--Management
Jun 1, 2004
28
0
0
US
Hi All,

I have this interesting scenario:

I have two columns (DeptID & ProdID) in my table and If I build an attribute for each of those columns and try to display it on the report, I get the following:
__________________________________________________________
DEPTID PRODUCTID
0300 01020
0400 01030
0500 01040
__________________________________________________________

Now, Ideally I have only a 2-digit DEPTID and a 3-digit PRODUCTID like this...
___________________________________________________________
DEPTID PRODUCTID
03 102
04 103
05 104
___________________________________________________________

i.e. I need to truncate the last two digits from my DEPTID and the first and last digit from my PRODUCTID.

Is that something that I should do while creating the attributes?

Please help me on this.

Thank you.

- Leo
 
LeftStr([DEPTID], 2.0)

The Prod id is a little trickier
I am writing the syntax from my head but you can use f(x) in the attribute editor to help you

RightStr(LeftStr([PRODID],4.0),3.0)

Lemme know if this works else I can elaborate further
 
Oops forgot to add, this is done in your attribute editor when you are creating your attribute.
 
Hey iolaper,

Thank you. I was looking for this function. I think I understood that and It seem to be working.

-Leo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top