cancel
Showing results for 
Search instead for 
Did you mean: 

FMS for Subtracting 2 UDF !!!

Former Member
0 Kudos

Hi Every One,

I have 3 UDF's with datatype Alphanumeric as U_GrossWt, U_TareWt and U_NetWt. I want to do as follow U_GrossWt - U_TareWt = U_NetWt through FMS. I have tried using this FMS but not succeeded.

SELECT Cast($[POR1.U_GrossWt.numeric as float]) - Cast($[POR1.U_TareWt.numeric as float])

When I run abouve FMS I get error message as shown below

1). [Microsoft][SQL Server Native Client 10.0][SQL Server]Incorrect syntax near 'Cast', expected 'AS'. 2). [Microsoft][SQL Server Native Client 10.0][SQL Server]Statement '' (SEVT) (s) could not be prepared.

Can anyone guide me on subtracting 2 UDF's of Alphanumeric Type through FMS.

Thanks,

Harshal Makwana

Accepted Solutions (1)

Accepted Solutions (1)

former_member227598
Active Contributor
0 Kudos

Hi,

(SELECT $[POR1.U_GrossWt.decimal] - $[POR1.U_TareWt.decimal] )

Thanks & Regards ,

Kamlesh Naware

Former Member
0 Kudos

Hi Kamlesh,

I Tried with your query but received following error message:

1). [Microsoft][SQL Server Native Client 10.0][SQL Server]Operand data type nvarchar is invalid for subtract operator. 2). [Microsoft][SQL Server Native Client 10.0][SQL Server]Statement '' (SEVT) (s) could not be prepared.

Please suggest.

Thanks,

Harshal Makwana

former_member227598
Active Contributor
0 Kudos

Hi,

Please create the GrossWt , Tare Wt & Net data type should be Unit and total & Structure Quantity, then check

Thanks & Regards ,

Kamlesh Naware

Former Member
0 Kudos

Hi Kamlesh,

I have tried and it works fine only changes I have did is replacing Decimal to Number as I was getting error on running FMS.

Thanks for your help.

Regards,

Harshal Makwana

Answers (0)