dbTalk Databases Forums  

Deriving Fiscal Year and Fiscal Month for an SSIS package

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Deriving Fiscal Year and Fiscal Month for an SSIS package in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
robboll
 
Posts: n/a

Default Deriving Fiscal Year and Fiscal Month for an SSIS package - 02-07-2010 , 08:15 PM






If I have an "Execute SQL Task" with sql that looks like this:

SELECT FLAG FROM "MyDB"."RUNorHOLD"
WHERE FY = '2010' AND PER = '4'

How can I turn '2010' and '4' into variables so it will reflect the
correct year and fiscal month regardless of when the package is run?

This may be easy but it shure has me going.

Thanks,

RBollinger

Reply With Quote
  #2  
Old   
Todd C
 
Posts: n/a

Default RE: Deriving Fiscal Year and Fiscal Month for an SSIS package - 02-08-2010 , 07:59 AM






Exactly what part of it are you having trouble with? The part that makes sure
you get "2010" and "4" no matter what, or the part where you want to load
those two values (whatever they may be) into package variables?

You could write your T-SQL statement as:
SELECT 2010 AS [FY], 4 AS [FM]

but then what is the point of even having the Execute SQL Task?

If you want to load these values into Package Variables, set the Result Set
of the Execute SQL Task to Single Row. Then on the Result Set page, add two
mappings, and name them 0 and 1.

Again, can you explain what you are trying to accomplish?
--
Todd C
MCTS SQL Server 2005


"robboll" wrote:

Quote:
If I have an "Execute SQL Task" with sql that looks like this:

SELECT FLAG FROM "MyDB"."RUNorHOLD"
WHERE FY = '2010' AND PER = '4'

How can I turn '2010' and '4' into variables so it will reflect the
correct year and fiscal month regardless of when the package is run?

This may be easy but it shure has me going.

Thanks,

RBollinger
.

Reply With Quote
  #3  
Old   
ROBBOLL
 
Posts: n/a

Default RE: Deriving Fiscal Year and Fiscal Month for an SSIS package - 03-11-2010 , 08:38 AM



Let me present this another way:

If the current Fiscal Year (FY) is 2010 and the current Fiscal Month
(PER) is 4

In a Script Task, what is the code necessary to derive that CurrFY = 2010
and CurrFM = 4 ?

Here is what I am trying to do:

There is a maintenance Table: tblMaint (When the column CLSD_FL turns to 1
(True) the data is avalable for processing and the package should run.

FY PER CLSD_FL
2009 11 1
2009 12 1
2009 13 1
2010 1 1
2010 2 1
2010 3 1
2010 4 1
2010 5 0 <-- current
2010 6 0

Currently I have two hard coded parameters and a results set set up:
oFY = 2010
oFM = 5
oFLAG (Result Set R/W string)

Each morning an Agent task checks to see if CLSD_FL changes to a 1 When it
changes to a 1 oFLAG is set to 1 and the job kicks off.

I am looking for the best method of setting this up so that it is not
necessary to manually change the parameters for each month.

Thanks for any help with this!

ROBBOLL

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.