cancel
Showing results for 
Search instead for 
Did you mean: 

cALCULATION OF udf ON UNIT PRICE

Former Member
0 Kudos

Hi All,

We have 3 udf's at row level for Length, width and Thickness. For a particular customer , we have to make certain calculations for the unit price which goes like LWT*0.123456.

Would it be possible to fetch the calculated value in unit price for the item? This has to be done for sales quotation. Please assist with the query.

Thanks,

joseph

Accepted Solutions (1)

Accepted Solutions (1)

former_member204969
Active Contributor
0 Kudos

Use this FMS:

SELECT $[QUT1.U_L.number]*$[QUT1.U_W.number]*$[QUT1.U_T.number]*0.123456

Former Member
0 Kudos

Hi Istvan,

Its givin the error " Oper and data type nvarchar is invalid for multiply operations. I have defined the 3 udf types as Units and totals and structure as measure. Is this the cause of the error??

Tanks,

Joseph

former_member196081
Active Contributor
0 Kudos

yes

All fields shuld be unit and total type.

regards

Deepak tyagi

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Joseph,

Try this, its working fine.


 SELECT ($[$38.U_Length.NUMBER] * $[$38.U_Width.NUMBER] * $[$38.U_Thickness.NUMBER] * 0.123456)

OR


Declare @UDF1 as numeric(19,6)
Declare @UDF2 as numeric(19,6)
Declare @UDF3 as numeric(19,6)
SET @UDF1 = $[QUT1.U_Length] 
SET @UDF2 = $[QUT1.U_Width] 
SET @UDF3 = $[QUT1.U_Thickness] 
SELECT  (@UDF1*@UDF2*@UDF3*0.12345)

Regards,

Madhan.

ashutosh_tomar
Contributor
0 Kudos

Hi Joseph,

Define all the udf's as Amount type and try the query :

SELECT $[QUT1.U_L.number]*$[QUT1.U_W.number]*$[QUT1.U_T.number]*0.123456

This will solve the issue.

Regards

Ashutosh

Edited by: Ashutosh T on Jun 17, 2010 12:57 PM

bhavank_gajjar
Active Contributor
0 Kudos

Hi Joseph,

go for this query(FMS) on Unit Price Field

 SELECT $[$38.U_Length] * $[$38.U_Width] $[$38.U_Thickness] * 0.123456 

it will work and if solved then close the thread.

Regards,

Bhavank