Showing posts with label package. Show all posts
Showing posts with label package. Show all posts

Monday, March 19, 2012

DateTime Package variable.. only Date no Time?

I have a package variable that is a datetime... how am I able to set the time of that variable? In visual studio on the variables screen if I click on value it brings up a calendar control - I can't seem to edit the time portion of the variable.

When I first click open the variables window it will say 9/1/2006 12:00:00 AM - but as soon as I click on the value box the 12:00:00 AM part will disappear and I can't edit it. I've tried on someone elses PC as well to make sure there isn't something wrong with my visual studio

Ideas?

You can edit the time in the Properties window: select the variable in Variables window and then click the Properties window, and type the time in Value property.

I'm not sure why the Variables window behaves differently, I'll file a bug report to consider.

|||

Press F4 to show the properties panel; then go to value and type in the date and time you want.

Rafael Salas

|||

Awesome thanks... I figured there had to be SOME way to set it. I've been creating packages every day at work for months now and never needed to set a time portion till today.

Actually I didn't even know there were properties of variables (now that I am in there I see you can make variables expressions... wow I wish I knew that earlier - I've been using scripts to set variables that I wanted to be expressions! - so I get a bonus I didn't know about with this question.)

Saturday, February 25, 2012

Dates in a DTS

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