on 05-22-2014 12:20 AM
Buena tarde a todos, estoy tratando de hacer un TN que bloquee la cantidad del detalle de una solicitud de traslado, el problema es que al momento de bloquear me lanza el siguiente error:
this is not permitted when the subquery follows =,!=,<,<=,>,>= or when the subquery is used as an expression
adjunto el codigo del bloqueo que estoy tratando de implementar, para que con su experiencia tal vez me puedan asesorar.
De antemano muchas gracias
if @object_type = '1250000001' and @transaction_type in ('U')
BEGIN
Declare @Cantidad AS DECIMAL(18,2)
Set @Cantidad = (Select T0.Quantity From WTQ1 T0 Where T0.Quantity <> -1 and T0.DocEntry =@list_of_cols_val_tab_del)
If @Cantidad > -1
Begin
Set @error = 1000
Set @error_message = 'No es permitido cambiar la Cantidad'
End
END
El Error es que la consulta para asignarle un valor a @Cantidad devuelve varios registros
Deberias declararlo asi:
Set @Cantidad = (Select sum(T0.Quantity) From WTQ1 T0 Where T0.Quantity <> -1 and T0.DocEntry =@list_of_cols_val_tab_del)
Saludos
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
108 | |
12 | |
11 | |
6 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.