on 05-06-2008 12:36 AM
Tengo un problema cuando creo variables para parametros de un reporte, por ejemplo tengo lo siguiente
declare @SN varchar(12)
set @SN = (select cardcode from ocrd where cardname = [%0])
Quisiera saber como puedo hacer para que me traiga solo los clientes y de una categoria.
Gracias
Ian,
Gracias por la ayuda... pero lo que quiero hacer es lo siguiente...
Select @spEMP=(SELECT T0.CardCode FROM [dbo].[OCRD] T0 WHERE T0.CardName='[%0]' AND T0.CardCode like 'PRAM%')
Cuando le pongo otra condicional mas toma todos los valores ... por ejemplo si tengo clientes que comienzan con el codigo PRAM y PREM me trae todos esos codigos sin importar lo que puse en el where de mi select.. como puedo hacer para que me traiga solo un tipo de codigo de cliente...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hola Christian,
Prueba con
set @SN = (select T0.CardCode from [dbo].[OCRD] T0 where T0.CardName = '[%0]')
Los corchetes, el dbo, el T0 y el '[%0'] todos son importantes para pedir el parametro.
Saludos,
Ian
Edited by: Ian Defilippi on May 5, 2008 10:28 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Puedo preguntar que es lo que quieres hacer??
A lo mejor es mas simple si expones todo el problema.
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 | |
12 | |
11 | |
6 | |
5 | |
4 | |
4 | |
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.