Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to check now() falls between two specific dates?

Tags:

datetime

mysql

I've a announcement table with the structure,

Msgid int,
title varchar(150)
message text
date_from datetime
date_to  datetime

I've want to list all the announcements which will be due today (i.e) announcements of which today's date falls b/w date_from and date_to.

any ideas?

like image 937
Vijay Avatar asked Nov 28 '22 11:11

Vijay


1 Answers

WHERE NOW() BETWEEN date_from AND date_to
like image 55
reko_t Avatar answered Dec 15 '22 22:12

reko_t