Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Can you please help me convert the 2 below sql scripts into load statements?
1) Concat(CONVERT(VARCHAR,[Calendar Year]),iif(len(CONVERT(VARCHAR,[Calendar Month Number]))= 1,'0'+CONVERT(VARCHAR,[Calendar Month Number]),CONVERT(VARCHAR,[Calendar Month Number]))) AS YEAR_MONTH
2) DATEADD(DAY, 2 - DATEPART(WEEKDAY, [Calendar Date]), [Calendar Date]) AS WEEK_BEGIN_DATE
Thank you in advance!
load ...
[Calendar Year]&num([Calendar Month Number],'00') as YEAR_MONTH,
// Assuming your week starts from Saturday. If it starts from other days then change the number highlighted in weekstart function. Week Number starts from.. 0 -Mon
weekstart([Calendar Date],0,5) as WEEK_BEGIN_DATE
load ...
[Calendar Year]&num([Calendar Month Number],'00') as YEAR_MONTH,
// Assuming your week starts from Saturday. If it starts from other days then change the number highlighted in weekstart function. Week Number starts from.. 0 -Mon
weekstart([Calendar Date],0,5) as WEEK_BEGIN_DATE
Sorry for the late reply. I was travelling.
Thank you this Kush! I appreciate your kind help.