Quantcast
Channel: SQL Server Integration Services forum
Viewing all articles
Browse latest Browse all 24688

how to find number of Fridays, sundays and saturdays between two given dates in ssis ?

$
0
0

How to find the number of Fridays, Sundays, and Saturdays between two given dates..?

I have a Weekly Pull  (FRI, SAT, SUN) to run every week deleting all 2018 and load all 2018 only Fri, sat, sun.


I have below query which can get only <g class="gr_ gr_27 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del" data-gr-id="27" id="27">SAT</g> and sun.


declare @Start_date DateTime, @end_Date DateTime
select @Start_date  = '20120801', @end_Date  = '20120830'

; WITH Date_Result(DateofWeek) AS (
Select @Start_date  Fecha
UNION ALL
SELECT DATEADD(day, 1, date of a week) Dateofweek
FROM Date_Result 
WHERE DateofWeek < @end_date
)
select Dateofweek from Date_result where DATEPART(DW, Dateofweek)in (1,7)
OPTION (MaxRecursion 0);

I want to get Friday, Saturday, Sunday and use SQL Task Editor and pass the variables start and end date.  

Help...




Viewing all articles
Browse latest Browse all 24688

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>