Skip to main content
Solved

How to get next Thursday date In GI?

  • 21 May 2024
  • 2 replies
  • 44 views

Hello Team

We have a requirement like get the next thursday date based on the current Date in GI. Tried in the SQL like below and it is working fine, Can you please provide Equivalent syntax in GI.

DECLARE in SQL @GivenDate DATE = '2024-05-15';  

SELECT DATEADD(DAY, (4 - DATEPART(WEEKDAY, @GivenDate) + 7) % 7, @GivenDate) AS NextThursday;

Could someone please help on this.

Thank you.

 

 

2 replies

Userlevel 7
Badge +8

Hi @saikrishnav35 ,

You should be able to use this formula:

=DATEADD(Today(), 'd', (5 - DayOfWeek(Today()) + 7) % 7)

Hope this helps!

Laura

Userlevel 2
Badge

Hi @lauraj46 

It works perfectly. Thank you!

Reply