How to find greater than and less than according to date in MYSQL php

MySQL 0 Comments

php mysql date comparing with greater than and smaller than MySQL Where DateTime is greater than today 22 May 2017 Select records where datetime is greater than the specified date Datetime equal or greater than today in MySQL. How to use greater than operator with date in mysql php. how to find greater than date compare with month in mysql

How to find greater than and less than according to date in MYSQL php

If we are find grater than and less than date in mysql so we cannot get proper solution due to compare first character of date with mysql table date string. for eg 20-8-2018 your string date and mysql string date 18-8-2018, so 20 is first character and compare with 18 day date not compare with month character is 8 and year 2018. so how comparing dates by month and year in mysql. how to find greater than date compare with month in mysql

We are provide some logic to find greater than and less than according to date in MYSQL php

 


DATE(676767677)

SELECT * FROM table WHERE DATE(order_datetime) BETWEEN '2004-10-01' AND '2004-10-03';


select * from tablename where LAST_DAY(Start_Date) = LAST_DAY(curdate()) and end_date <= curdate() + interval 30 day


select * from tablename where LAST_DAY(Start_Date) = LAST_DAY(curdate()) and end_date <= curdate() + interval 30 day


select * from tablename where where DATE_FORMAT(Start_Date ,'%Y-%m-01') = DATE_FORMAT(curdate(),'%Y-%m-01')
<h3>other logic to find greater than and less than according to date in MYSQL php</h3>
$mrkssht=mysql_query("Select DISTINCT date from table order by id desc LIMIT 0,12");
while($rowmrkshts=mysql_fetch_array($mrkssht)){
$date = $rowmrkshts['date '];
// echo $date ;
//echo '<br>';

$start_date = strtotime("$dtliststs");
$end_date=strtotime("$date ");
if($end_date > $start_date){

}
?>

how to solve php mysql date comparing with greater than and smaller than MySQL Where DateTime is greater than today 22 May 2017 Select records where datetime is greater than the specified date Datetime equal or greater than today in MySQL. How to use greater than operator with date in mysql php. how to find greater than date compare with month in mysql