Hi Dustin,
You can use a simple formula to calculate how many 'values' along the
string your 4-digit number is:
Value index = Integer(Position in string / 5) + 1
For example, the value index of 4187 in the string "4185~4186~4187~4188"
= Integer(11 / 5) + 1
= Integer(2.2) + 1
= 2 + 1
= 3
Or, the value index of 4188 in the string "4185~4186~4187~4188"
= Integer(16 / 5) + 1
= Integer(3.2) + 1
= 3 + 1
= 4
All you need to do is use the correct Crystal syntax (I think someone
mentioned the Crystal function InStr() which will cover the Position in
string element of the formula).
I hope this helps,
Andy Watts.
________________________________________
From: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
[mailto:vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com> ] On
Behalf Of melissa hietala
Sent: Thursday, June 17, 2010 11:53 AM
To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
Subject: [Vantage] Crystal Syntax Help
I have a string in the following format in crystal:
"4185~4186~4187~4188"
There is anywhere from 1 to 10 values in the string.
Say I would like to find the placement of the string "4187" in this
string. How would I return a value of 3? (being that "4187" is held in
the 3rd position of this string)
Hope this makes sense and any help is appreciated.
Thanks
Dustin Biniek
Andy Watts
IT Manager
Ripley Engineering Ltd
Tel: 01256-473940/464167
Mob:
www.ripley-eng.co.uk
[Non-text portions of this message have been removed]
You can use a simple formula to calculate how many 'values' along the
string your 4-digit number is:
Value index = Integer(Position in string / 5) + 1
For example, the value index of 4187 in the string "4185~4186~4187~4188"
= Integer(11 / 5) + 1
= Integer(2.2) + 1
= 2 + 1
= 3
Or, the value index of 4188 in the string "4185~4186~4187~4188"
= Integer(16 / 5) + 1
= Integer(3.2) + 1
= 3 + 1
= 4
All you need to do is use the correct Crystal syntax (I think someone
mentioned the Crystal function InStr() which will cover the Position in
string element of the formula).
I hope this helps,
Andy Watts.
________________________________________
From: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
[mailto:vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com> ] On
Behalf Of melissa hietala
Sent: Thursday, June 17, 2010 11:53 AM
To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
Subject: [Vantage] Crystal Syntax Help
I have a string in the following format in crystal:
"4185~4186~4187~4188"
There is anywhere from 1 to 10 values in the string.
Say I would like to find the placement of the string "4187" in this
string. How would I return a value of 3? (being that "4187" is held in
the 3rd position of this string)
Hope this makes sense and any help is appreciated.
Thanks
Dustin Biniek
Andy Watts
IT Manager
Ripley Engineering Ltd
Tel: 01256-473940/464167
Mob:
www.ripley-eng.co.uk
[Non-text portions of this message have been removed]