on 10-14-2010 10:33 PM
Jóvenes alguien me podría ayudar para poder hacer funcionar este query, la persona que me lo proporciono no la localizo.
El query es el siguiente.
declare @desde as datetime
declare @hasta as datetime
declare @cuenta as varchar(14)
select @Cuenta = t0.u_formatco from .[@BANCOS] t0 where t0.u_BANKNAME = '[%0]'
select @desde = min(t1.u_fecha) from .[@dia] t1
select @hasta = t2.u_fecha from .[@dia] t2 where t2.u_fecha = '[%2]'
SELECT T1.FormatCode,t1.acctNAME 'Nombre Cuenta',
t0.ref1,t0.ref2,t0.refdate,t0.credit 'Monto cheque'
FROM .[JDT1] T0 inner join .[oact] T1 on t0.Account=t1.Acctcode
WHERE
T0.RefDate >= @desde and T0.RefDate <= @hasta
and T1.FormatCode = @Cuenta
and t0.extrmatch = 0
and t0.credit > 0
De antemano muy agradecido.
Saludos
Hola...
Qué mensaje de error te arroja el query?
Saludos
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hola....
Tu query segun se puede apreciar se basa en información de tablas de usuario...
Para revisarlo, te sugeriría que lo vayas desagregando...
Primero revisa que la información esté quedando en las variables...
declare @desde as datetime
declare @hasta as datetime
declare @cuenta as varchar(14)
set @Cuenta = (SELECT t0.u_formatco from [dbo].[@BANCOS] t0 where t0.u_BANKNAME = [%0])
set @desde = (SELECT min(t1.u_fecha) from [dbo].[@dia] t1)
set @hasta = (SELECT t2.u_fecha from [dbo].[@dia] t2 where t2.u_fecha = [%2]
select @Cuenta, @desde, @hasta
Luego que te asegures que en las variables están quedando los datos...pasas a revisar la segunda parte...
Saludos Cordiales,
Edited by: Paul Ponce on Oct 15, 2010 4:57 PM
User | Count |
---|---|
103 | |
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.