I am trying to get the record from database with current date only here is the query I have tried bu getting no records from table:
SELECT *
FROM Transactions
WHERE transaction_date = GETDATE();
It's the current date, so the records with future dates don't exist. You just need to get all transactions greater than 00:00:00
of today.
SELECT * FROM `Transactions` WHERE transaction_date >= CURRENT_DATE+" 00:00:00";
Just compare the date part
Select *from Transactions
WHERE
CONVERT(char(10), transaction_date ,126)=CONVERT(char(10), getdate(),126);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With