Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Good morning All,
I have the following script:
[FY2013 NL TRANS]:LOAD CostCentre,
ExpenseCode,
Suffix,
Date(PostingDate) as Date,
Month(PostingDate) as Month,
Year(PostingDate) as Year,
Narrative,
BaseValue as [FY13 Value],
CompanyKey
where ExpenseCode >='8000'
and (CompanyKey ='01' or CompanyKey ='20' or CompanyKey ='25' or CompanyKey ='29' or CompanyKey ='32' or CompanyKey ='36');SQL SELECT CostCentre,
ExpenseCode,
Suffix,
PostingDate,
Narrative,
BaseValue,
CompanyKey
FROM "EIE_DW".dbo."NL_00_OTRAN";
The data that pulls through are for 2012 and 2013, I only want to work with 2013 data.
How can I specify this in my script?
Thanks
*R*
Change in load script like
[FY2013 NL TRANS]:LOAD CostCentre,
ExpenseCode,
Suffix,
Date(PostingDate) as Date,
Month(PostingDate) as Month,
Year(PostingDate) as Year,
Narrative,
BaseValue as [FY13 Value],
CompanyKey
where ExpenseCode >='8000'
and (CompanyKey ='01' or CompanyKey ='20' or CompanyKey ='25' or CompanyKey ='29' orCompanyKey ='32' or CompanyKey ='36') and Year(PostingDate) = '2013' ;SQL SELECT CostCentre,
ExpenseCode,
Suffix,
PostingDate,
Narrative,
BaseValue,
CompanyKey
FROM "EIE_DW".dbo."NL_00_OTRAN";
FY2013 NL TRANS]:
LOAD CostCentre,
ExpenseCode,
Suffix,
Date(PostingDate) as Date,
Month(PostingDate) as Month,
Year(PostingDate) as Year,
Narrative,
BaseValue as [FY13 Value],
CompanyKey;
SQL SELECT CostCentre,
ExpenseCode,
Suffix,
PostingDate,
Narrative,
BaseValue,
CompanyKey
FROM "EIE_DW".dbo."NL_00_OTRAN"
Where CompanyKey in ('01','20','25','29','32','36' and ExpenseCode >='8000' and
PostingDate >= '2013-01-01' and PostingDate <= '2013-12-31'
You can change Date as per your System Date...
PostingDate >= '2013-01-01' and PostingDate <= '2013-12-31'
will only pull 2013 data.
Change in load script like
[FY2013 NL TRANS]:LOAD CostCentre,
ExpenseCode,
Suffix,
Date(PostingDate) as Date,
Month(PostingDate) as Month,
Year(PostingDate) as Year,
Narrative,
BaseValue as [FY13 Value],
CompanyKey
where ExpenseCode >='8000'
and (CompanyKey ='01' or CompanyKey ='20' or CompanyKey ='25' or CompanyKey ='29' orCompanyKey ='32' or CompanyKey ='36') and Year(PostingDate) = '2013' ;SQL SELECT CostCentre,
ExpenseCode,
Suffix,
PostingDate,
Narrative,
BaseValue,
CompanyKey
FROM "EIE_DW".dbo."NL_00_OTRAN";
PostingDate Between '2013-01-01' and '2013-12-31'
will load 2013 data.
Thank Anand,
It works!