on 2021 Jun 18 10:15 AM
hello Expert i am facing the above error while executing below stored procedure in transaction notification.
IF @transaction_type = 'A' AND @object_type = '13'
BEGIN
DECLARE @FreInv NVARCHAR SET @FreInv = (SELECT ((((T1.DocTotal+T1.DiscSum)-T1.RoundDif) *.7/100) + T1.RoundDif)
FROM OINV T1 WHERE T1.DocEntry=@list_of_cols_val_tab_del )
If exists (SELECT T0.DocEntry FROM OINV T0 Inner Join INV1 T2 On T0.DocEntry=T2.DocEntry
WHERE @FreInv < '0.00' AND T0.DocEntry=@list_of_cols_val_tab_del)
Begin
SET @error = 122 SET
@error_message = 'Test Error'
End
End
Request clarification before answering.
Hi Ali,
If you are calculating a numerical value:
SET @FreInv = (SELECT ((((T1.DocTotal+T1.DiscSum)-T1.RoundDif) *.7/100) + T1.RoundDif)
and later making a numerical comparison:
WHERE @FreInv < '0.00'
then why are you using a text type?
DECLARE @FreInv NVARCHAR
Please check the numerical type of the OINV.DocTotal field, and apply it to the @FreInv variable, instead of NVARCHAR. Also change the comparison to:
WHERE @FreInv < 0
Regards,
Johan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Johan :
i have change the below and now its working good .
Thanks a lot Brother
DECLARE @FreInv Numeric
User | Count |
---|---|
98 | |
16 | |
6 | |
5 | |
5 | |
4 | |
4 | |
3 | |
3 | |
2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.