calculated field
-
- Posts: 11
- Joined: Tue Oct 10, 2017 12:44 pm
calculated field
I am creating a calculated field in ver8.1 and am getting an error.____I simply use Qty * Value (both of which are fields in my sql query) and i receive invalid syntax error.____qty can be a double data type - 350.435 __value is a normally a whole value amount values. .35, 250.00____in the database(sql)the values for qty are also double data type and value are money type.____in my vb program I can format the end result and I do get a correct value____Format(myVar, "##,###,###.00")____However, in creating a calculated field I don^t have that option.____How can R&R do the same?____Thanks____
-
- Posts: 11
- Joined: Tue Oct 10, 2017 12:44 pm
==> RE: calculated field
Using SQL 2000.__Yes value does display with a 999 format. However, Qty shows as char and I set that value to character cnt of 6.____I used the expression:____Val(Qty) * value____The line item did calculate correctly. ____However, the GrandTotal (a sum) field didn^t.____Its off $.01____Can you think of any reason why?
=> RE: calculated field
[updated:LAST EDITED ON Jun-03-08 AT 07:42 AM (EST)]What SQL platform are you using?____When you place the field on the report, does each one display with a 9999 format showing that R&R considers them as numeric?____If either shows as XXX R&R would consider it as a character field and you would need to use the VAL() function to convert from character to numeric so that you could use the field in a numeric expression.____Kathleen__R&R Support
===> RE: calculated field
Try adding some rounding and see if it helps.____Round(round(Val(Qty),2) * round(value,2),2)______Kathleen__R&R Support