Quantcast
Channel: SCN: Message List - SAP Adaptive Server Enterprise (SAP ASE) for Custom Applications
Viewing all articles
Browse latest Browse all 3587

Re: How can I get the start date & end date of given week number or month

$
0
0

if you want to have different day as start of the week, e.g. Monday: set datefirst 1

the select statement with dateadd/datepart stays the same

 

Don't think calculating a date based on just a week number is possible.

Different years have different dates for week numbers. And don't forget leap years.

 

you can still loop on week numbers, but do all calculations on a full date

next week:  select dateadd(dw, 1, @curr_date_time)


Viewing all articles
Browse latest Browse all 3587

Trending Articles



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