BOB: Business Objects Board
Not endorsed by or affiliated with SAP

Register | Login 

Follow BOB on Twitter! 
Follow BOB on Twitter! (Opens a new window)  

General Notice: No events within the next 45 days.

[IDT 4.x] MTD calculation - First Monday of the Month to Last Sunday


 
Search this topic... | Search Semantic Layer / Universe Designer... | Search Box
Register or Login to Post    Forum Index -> Semantic Layer / Universe Designer  Previous TopicPrint TopicNext Topic
Author Message
assist
Principal Member
Principal Member



Joined: 17 Apr 2006

Posts: 214



PostPosted: Thu Aug 29, 2019 2:45 am 
Post subject: MTD calculation - First Monday of the Month to Last Sunday

Dear All,

I want to calculate MTD with SAP HANA SQL database
Logic:
From Date: First Monday of the Month
To Date: Last Sunday of the Month

For e.g. if today is 29-Aug-2019 then MTD should be calculate from 1st Monday of current month that is 05-Aug-2019 to last Sunday of current month that is 25-Aug-2019

In ORACLE SQL it can achieve with below syntax:
select next_day(trunc(sysdate, 'MONTH')-1, 'Monday') First_Monday_in_month from dual

select next_day(trunc(sysdate, 'YEAR')-1, 'Monday') First_Monday_in_year from dual

But I don't know how can it will be achieved in SAP HANA SQL,
Does anyone has any idea to achieve it?
Back to top
Display posts from previous:   
Register or Login to Post    Forum Index -> Semantic Layer / Universe Designer  Previous TopicPrint TopicNext Topic
Page 1 of 1 All times are GMT - 5 Hours
 
Jump to:  

Index | About | FAQ | RAG | Privacy | Search |  Register |  Login 

Get community updates via Twitter:

Not endorsed by or affiliated with SAP
Powered by phpBB © phpBB Group
Generated in 0.0258 seconds using 17 queries. (SQL 0.0022 Parse 0.0008 Other 0.0228)
CCBot/2.0 (https://commoncrawl.org/faq/)
Hosted by ForumTopics.com | Terms of Service
phpBB Customizations by the phpBBDoctor.com
Shameless plug for MomentsOfLight.com Moments of Light Logo