Gareth Horton
July 12th, 2002, 02:55 PM
David Underwood wrote:
> I am using v5.00 and need to include a trap in a template that will exclude any data that has anything but a zero at a particular position. I don't see that there is a way for me to do this. All I can seem to do is create a trap that will give me everything that has a zero, which excludes the data I need.
>
> Can anyone point me in the right direction to get what I need?
>
> Thanks in advance,
> David Underwood
David, here’s a different approach.
I’d create a calculated field that contains only the character that needs to be nonzero. Suppose your field is PARTNUM and a typical string was something like AN423304, and the zero is in the 7th position. Create a calcluated field (in Table view, Data > Calculated Field). Call the field ZEROTEST. For the expression, use SUBSTR(PARTNUM,7,1) to grab the character in the 7th position, 1 character wide. Then create a filter so that ZEROTEST <> 0.
Mark!
> I am using v5.00 and need to include a trap in a template that will exclude any data that has anything but a zero at a particular position. I don't see that there is a way for me to do this. All I can seem to do is create a trap that will give me everything that has a zero, which excludes the data I need.
>
> Can anyone point me in the right direction to get what I need?
>
> Thanks in advance,
> David Underwood
David, here’s a different approach.
I’d create a calculated field that contains only the character that needs to be nonzero. Suppose your field is PARTNUM and a typical string was something like AN423304, and the zero is in the 7th position. Create a calcluated field (in Table view, Data > Calculated Field). Call the field ZEROTEST. For the expression, use SUBSTR(PARTNUM,7,1) to grab the character in the 7th position, 1 character wide. Then create a filter so that ZEROTEST <> 0.
Mark!