Count number of days. subtract 7 * number of weeks. Depends on where your week starts - if it is a sunday that should be correct - if not might need to be amended using start and end date days.
Other option - start at start date and count 1 for each day omitting sundays Can be done easily using a cte.
If you have a date table which includes the day name you can just join to that. That would be a good idea if you need this sort of calculation because you will probably have to deal with bank holidays and such at some point.
========================================== Cursors are useful if you don't know sql. SSIS can be used in a similar way. Beer is not cold and it isn't fizzy.
Found the solution, DATENAME(DW,@frmDte)= 'Sunday'
-Thanks
That will just tell you if the start date is a sunday - not if there are sundays between the two dates.
========================================== Cursors are useful if you don't know sql. SSIS can be used in a similar way. Beer is not cold and it isn't fizzy.