calculated field

Meeting place for R&R customers and clients to share tips and ideas. Post your questions, messages or problems here.
Post Reply
mgonzales3
Posts: 11
Joined: Tue Oct 10, 2017 12:44 pm

calculated field

Post by mgonzales3 » Mon Jun 02, 2008 7:37 am

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____

mgonzales3
Posts: 11
Joined: Tue Oct 10, 2017 12:44 pm

==> RE: calculated field

Post by mgonzales3 » Tue Jun 03, 2008 7:04 am

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?

kfleming
Posts: 5795
Joined: Tue Oct 10, 2017 12:44 pm

=> RE: calculated field

Post by kfleming » Tue Jun 03, 2008 7:40 am

[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

kfleming
Posts: 5795
Joined: Tue Oct 10, 2017 12:44 pm

===> RE: calculated field

Post by kfleming » Wed Jun 04, 2008 7:06 am

Try adding some rounding and see if it helps.____Round(round(Val(Qty),2) * round(value,2),2)______Kathleen__R&R Support

Post Reply