Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Buenas tardes.
Estimados, espero estén muy bien, en está oportunidad solicito de su ayuda para que me orienten de como hacer en el Script de QV para crear un archivo QVD con el siguiente query SQL.
OLEDB CONNECT TO
SELECT rotCode, DP.dmdCode, dmdOrder, cusCode, jrnCode, dmdSystemDate, dmdDate,
convert(varchar,dmdDate,105) AS Fecha,
DATEPART(year, dmdDate) as Año,
DATEPART(month, dmdDate) as Mes,
DATEPART(WEEK, dmdDate) as Semana,
DATEPART(WEEKDAY, dmdDate) as Dia_Semana,
DATEPART(day, dmdDate) as Dia,
dptNetAmount,
dptQuantity
from Demand as D
Join DemandProduct as DP
on D.dmdCode = DP.dmdCode
where dmdOrder = 1 and dmdSystemDate > (select convert (char (10), getdate(), 112));
Actualmente este query me trae correctamente la información.
Agradezco de antemano su colaboración.
Hola Luis,
TuTabla:
OLEDB CONNECT TO
SELECT rotCode, DP.dmdCode, dmdOrder, cusCode, jrnCode, dmdSystemDate, dmdDate,
convert(varchar,dmdDate,105) AS Fecha,
DATEPART(year, dmdDate) as Año,
DATEPART(month, dmdDate) as Mes,
DATEPART(WEEK, dmdDate) as Semana,
DATEPART(WEEKDAY, dmdDate) as Dia_Semana,
DATEPART(day, dmdDate) as Dia,
dptNetAmount,
dptQuantity
from Demand as D
Join DemandProduct as DP
on D.dmdCode = DP.dmdCode
where dmdOrder = 1 and dmdSystemDate > (select convert (char (10), getdate(), 112));
STORE TuTabla into Tutabla.qvd(qvd)
Saludos
Hola Luis,
TuTabla:
OLEDB CONNECT TO
SELECT rotCode, DP.dmdCode, dmdOrder, cusCode, jrnCode, dmdSystemDate, dmdDate,
convert(varchar,dmdDate,105) AS Fecha,
DATEPART(year, dmdDate) as Año,
DATEPART(month, dmdDate) as Mes,
DATEPART(WEEK, dmdDate) as Semana,
DATEPART(WEEKDAY, dmdDate) as Dia_Semana,
DATEPART(day, dmdDate) as Dia,
dptNetAmount,
dptQuantity
from Demand as D
Join DemandProduct as DP
on D.dmdCode = DP.dmdCode
where dmdOrder = 1 and dmdSystemDate > (select convert (char (10), getdate(), 112));
STORE TuTabla into Tutabla.qvd(qvd)
Saludos
Muchas gracias Jordi, ahora se que hay que darle el nombre antes de la conexión OLEDB, lo deje así y funcionó perfecto.
Diario:
OLEDB CONNECT TO
SELECT rotCode, DP.dmdCode, dmdOrder, cusCode, jrnCode, dmdSystemDate, dmdDate,
convert(varchar,dmdDate,105) AS aclDate,
DATEPART(year, dmdDate) as aclYear,
DATEPART(month, dmdDate) as aclMonth,
DATEPART(WEEK, dmdDate) as aclWeek,
DATEPART(WEEKDAY, dmdDate) as aclWeekday,
DATEPART(day, dmdDate) as aclDay,
dptNetAmount,
dptQuantity
from Demand as D
Join DemandProduct as DP
on D.dmdCode = DP.dmdCode
where dmdOrder = 1 and dmdSystemDate > (select convert (char (10), getdate(), 112));
Store Mensual into DemandD.qvd (qvd);
DROP Table Diario;
Genial Luis,
Saludos.