0

could you please help me to write query for below condition, i want to fetch record which meet the condition like (current date + 7) must be equal to sdate. Ex:- suppose current date is 2022-02-23, then row 1 and row 4 should come. suppose current date is 2022-02-25, then row 2 should come.

WB.DATA table

PERIOD HSID SDATE START
2022-09-15 184 2022-03-03 N
2022-09-15 184 2022-03-05 Y
2022-09-15 183 2022-01-06 N
2022-09-15 183 2022-03-03 Y
Rohini Kumari
  • 41
  • 2
  • 6
  • Does this answer your question? [MySQL Select last 7 days](https://stackoverflow.com/questions/24272335/mysql-select-last-7-days) – sajjad rezaei Feb 23 '22 at 06:31

2 Answers2

1

You may use:

SELECT *
FROM yourTable
WHERE SDATE = CURRENT DATE + 7 DAYS;
Tim Biegeleisen
  • 502,043
  • 27
  • 286
  • 360
0

Try this

SELECT * FROM {tablename} WHERE SDATE = (NOW() + INTERVAL 7 DAY)
Eugene K
  • 11
  • 2