Does the function set include any conversions? When I import a table from some sites, numeric data comes in as character and I can't see any method to treat it as numeric.
Thanks,
Chris
Kirix Support Forums
Conversion Functions
3 posts
• Page 1 of 1
Re: Conversion Functions
Strata does have conversion functions. Two options for you:
1. If you go to the View Menu and select the Design view, you are presented with a structure editor. For those fields that you want to make numeric, you can click on the word "Character" in the Type column and use the drop-down menu to select Numeric. Toggle back to the Table view to see the change take place.
2. Alternatively, you can convert fields using calculated fields, which gives you a lot more precision. If you take a look at the screencast, you can see how to create calculated fields. The function you want to use for changing a character to a value is the val() function. For numeric to character you would use the str() function. From string to date you would use the date() function.
Our documentation is poor at the moment, but you can see all the functions available to you to use in calculated fields here:
EDIT: The functions can currently be found here: http://www.kirix.com/olddocs/Category:SQL_Functions However, we're in the process of merging this information into our current help section. I'll repost the correct link when it is available.
A few other useful functions for use in cleaning up your data are trim() and lpad() and rpad().
Hope that helps,
ken
1. If you go to the View Menu and select the Design view, you are presented with a structure editor. For those fields that you want to make numeric, you can click on the word "Character" in the Type column and use the drop-down menu to select Numeric. Toggle back to the Table view to see the change take place.
2. Alternatively, you can convert fields using calculated fields, which gives you a lot more precision. If you take a look at the screencast, you can see how to create calculated fields. The function you want to use for changing a character to a value is the val() function. For numeric to character you would use the str() function. From string to date you would use the date() function.
Our documentation is poor at the moment, but you can see all the functions available to you to use in calculated fields here:
EDIT: The functions can currently be found here: http://www.kirix.com/olddocs/Category:SQL_Functions However, we're in the process of merging this information into our current help section. I'll repost the correct link when it is available.
A few other useful functions for use in cleaning up your data are trim() and lpad() and rpad().
Hope that helps,
ken
Ken Kaczmarek
Kirix Support Team
Kirix Support Team
-
Ken - Kirix Support Team
- Posts: 147
- Joined: Mon Dec 19, 2005 10:36 am
Re: Conversion Functions
Hello,
To convert from a string to a number, try using
To convert from a number to a character field, the following is used:
Similarly, converting from a date to string looks like this
Hope this helps,
Ben
To convert from a string to a number, try using
- Code: Select all
VAL( source_field )
To convert from a number to a character field, the following is used:
- Code: Select all
STR( source_field, number of decimals )
Similarly, converting from a date to string looks like this
- Code: Select all
STR( date_field )
Hope this helps,
Ben
Ben Williams
Kirix Support Team
Kirix Support Team
-
Ben - Kirix Support Team
- Posts: 525
- Joined: Mon Dec 19, 2005 6:29 am
3 posts
· Page 1 of 1
Return to Strata Help & Feedback