A
Amir
Hi!
I have a qustion about converting text values to numeric values in a
specified way.
How can I make a query that will convert string typed fractions like "4/10",
"1/3", and the text "full" to the following number typed values:
0.4, 0.3333.., 1 (1 is for the string "full").
How can I create a query that will do that automatically?
Here are the detailes if you're interested:
============================================================================
I have an imported table that has a text field called 'fraction', and field
called 'All', with values like these:
Fraction All
"2/4" 2
"1/2" 1
"7/8" 4
"5/14" 7
"full" 9
"3/9" 4
The rules are as following:
1. The value in the 'All' field are always half of the number written in the
right side of the '/' in the Fraction field.
2. If it's an odd number, then the number in the All field is half minus
0.5.
3. "full" means 1 (equals to 18/18 in the line I wrote), I hope you
understand why.. If not I would be happy to explain.
4. the Fraction field is a text type field.
5. the All field is an interger type field.
6. I have no control over the original table since it's an imported table.
What I wish to do is to convert the values in the Fraction field to number
values like as followed:
"2/4" - will become 0.5
"1/2" -> 0.5
"7/8" -> 0.875
"5/14" -> 0.357142857...
"full" -> 1
"3/9" -> 0.33333..
============================================================================
I would be grateful if you could answer!
Regards,
Amir.
I have a qustion about converting text values to numeric values in a
specified way.
How can I make a query that will convert string typed fractions like "4/10",
"1/3", and the text "full" to the following number typed values:
0.4, 0.3333.., 1 (1 is for the string "full").
How can I create a query that will do that automatically?
Here are the detailes if you're interested:
============================================================================
I have an imported table that has a text field called 'fraction', and field
called 'All', with values like these:
Fraction All
"2/4" 2
"1/2" 1
"7/8" 4
"5/14" 7
"full" 9
"3/9" 4
The rules are as following:
1. The value in the 'All' field are always half of the number written in the
right side of the '/' in the Fraction field.
2. If it's an odd number, then the number in the All field is half minus
0.5.
3. "full" means 1 (equals to 18/18 in the line I wrote), I hope you
understand why.. If not I would be happy to explain.
4. the Fraction field is a text type field.
5. the All field is an interger type field.
6. I have no control over the original table since it's an imported table.
What I wish to do is to convert the values in the Fraction field to number
values like as followed:
"2/4" - will become 0.5
"1/2" -> 0.5
"7/8" -> 0.875
"5/14" -> 0.357142857...
"full" -> 1
"3/9" -> 0.33333..
============================================================================
I would be grateful if you could answer!
Regards,
Amir.