I need a help on the SQL Query where i have to pull the data with the expiry date of today including the next 8 days. My table stores the date using the TimeStamp format. I am using PHP to store the values
Which flavour of SQL are you using? MS-SQL, MySQL, Oracle?
If it’s MySQL, it could be like:
SELECT *
FROM tableA
WHERE expiryDate BETWEEN (current_date and ADDDATE(CURRENT_DATE, INTERVAL 8 DAY))
/* BETWEEN is inclusive - includes dates of range, not just dates between)*/
HTH,
Hi,
I am using MYSQL and this solved my issue. Thanks for the reply.
- Jaden
This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.