General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Determining field format in a table
How can I determine the field definition in a table that is format, and then use that in a Transform() function.
Example: a field as N(5,2)
What I ultimately want achieve is getting a string version that field that is formatted to the same number of decimals.
Example, if the field is defined as N(5,2) and the values is 2.50, I want as string that reads “2.50”, if the value is 1.00, I want a string that is ”1.00”. But I cannot hard-code the number of decimals, it must come from the field definitions in the tables.
If it is an integer, then it will not have any decimals.
I must use the field data to determine the format of the string that I want to show in some html page I am building.
Right now, when I use the Transfrom() function, it will omit the decimals if the value is a whole number.
Transform(1.00) returns “1”, but I want “1.00”
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only