on 12-07-2015 9:18 PM
Hola a todos
Estoy tratando de crear una busqueda formulada y me manda un error "Operand data type nvarchar is invalid for divide operator
El campo es U_ValorLetra declarado como price, el cual es resultado de una division entre un campo de cabecera y un campo de usuario
1- U_CANTLETRAS declarado como INT
2- DocTotal
SELECT $[ORDR.Doctotal] / $[ORDR.U_CantLetras]
Gracias
Buenos días
Puedes pegar la información del sistema de ambos campos?
Atte.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hola Sara, el problema que tienes es que estás tratando de dividir un valor char entre uno numérico, lo que necesitas es convertirlos a número ambos, para garantizar que funcione la división
intenta con
SELECT cast($[ORDR.Doctotal] as int) / $[ORDR.U_CantLetras]
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hola oye no se que plantees hacer
pero seria algo así
declare @doc int
set @doc= 10
SELECT (Doctotal/ @doc) AS Resultado from ORDR
si lo que quieres es dividir
pero en este caso queme el valor
por fa plantea Bien que es lo que necesitas
y te ayudo con mucho gusto
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
102 | |
14 | |
10 | |
5 | |
4 | |
3 | |
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.