I am running a DTS package and the dates are hard coded...which means I have
to change the date each time I go to run it.
I would like to change it so that it does it automaticaly...so when it runs,
it takes one off the system date and transfers the data...so it only
transfers the previous days data.
Can anyone help, please.
Here is the package details
****************************************
***
SELECT IDTYPP, IDINVN, IDLINE, IDCUNO,
TRIM(IDPRDC) AS IDPRDC, TRIM(IDUNIT) AS IDUNIT,
OLCONV,
CASE
WHEN IDTYPP = 2 THEN -OLOQTY
ELSE OLOQTY
END OLOQTY,
CASE
WHEN IDTYPP = 2 THEN -IDQTY
ELSE IDQTY
END IDQTY,
IDSALP - (IDSALP * IDDCPR / 100) AS IDNPRC,
CASE
WHEN IDTYPP = 1 THEN IDAMOU * IDEXR3
ELSE -IDAMOU * IDEXR3
END IDAMOU,
CASE
WHEN IDTYPP = 1 THEN IDCOSP * IDEXR3
ELSE -IDCOSP * IDEXR3
END IDCOSP,
TRIM(IDCAGR) AS IDCAGR, TRIM(IDSALE) AS IDSALE, IDIDAT,
CASE
WHEN IDTYPP = 1 THEN IDQTY * IDCOSP * IDEXR3
ELSE -IDQTY * IDCOSP * IDEXR3
END IDLCVA
FROM LTR403FLL.SR3ISD D
LEFT OUTER JOIN LTR403FLL.SRBSOL O
ON D.IDORNO = O.OLORNO
AND D.IDOLIN = O.OLLINE
WHERE IDPERI >= 200411
AND IDIDAT >= 20050301 AND IDIDAT < 20050307
****************************************
******
The line
AND IDIDAT >= 20050301 AND IDIDAT < 20050307
is the one I would like to change to retrieve the data from the previous daySet up global variables for the dates you want to assign on the fly.
You can then set them in ActiveX scripts or using a dynamic properties task.
Simon Worth
"Billy" <Billy@.discussions.microsoft.com> wrote in message
news:B1EE60B2-2E10-46DC-891C-FFAB658F6562@.microsoft.com...
> I am running a DTS package and the dates are hard coded...which means I
have
> to change the date each time I go to run it.
> I would like to change it so that it does it automaticaly...so when it
runs,
> it takes one off the system date and transfers the data...so it only
> transfers the previous days data.
> Can anyone help, please.
> Here is the package details
> ****************************************
***
> SELECT IDTYPP, IDINVN, IDLINE, IDCUNO,
> TRIM(IDPRDC) AS IDPRDC, TRIM(IDUNIT) AS IDUNIT,
> OLCONV,
> CASE
> WHEN IDTYPP = 2 THEN -OLOQTY
> ELSE OLOQTY
> END OLOQTY,
> CASE
> WHEN IDTYPP = 2 THEN -IDQTY
> ELSE IDQTY
> END IDQTY,
> IDSALP - (IDSALP * IDDCPR / 100) AS IDNPRC,
> CASE
> WHEN IDTYPP = 1 THEN IDAMOU * IDEXR3
> ELSE -IDAMOU * IDEXR3
> END IDAMOU,
> CASE
> WHEN IDTYPP = 1 THEN IDCOSP * IDEXR3
> ELSE -IDCOSP * IDEXR3
> END IDCOSP,
> TRIM(IDCAGR) AS IDCAGR, TRIM(IDSALE) AS IDSALE, IDIDAT,
> CASE
> WHEN IDTYPP = 1 THEN IDQTY * IDCOSP * IDEXR3
> ELSE -IDQTY * IDCOSP * IDEXR3
> END IDLCVA
> FROM LTR403FLL.SR3ISD D
> LEFT OUTER JOIN LTR403FLL.SRBSOL O
> ON D.IDORNO = O.OLORNO
> AND D.IDOLIN = O.OLLINE
> WHERE IDPERI >= 200411
> AND IDIDAT >= 20050301 AND IDIDAT < 20050307
> ****************************************
******
> The line
> AND IDIDAT >= 20050301 AND IDIDAT < 20050307
> is the one I would like to change to retrieve the data from the previous
day
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment