Solved

How to get next Thursday date In GI?


Userlevel 2
Badge

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.

 

 

icon

Best answer by lauraj46 21 May 2024, 21:31

View original

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


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved