Select data between a date/time range

后端 未结 8 1864
迷失自我
迷失自我 2020-11-27 14:43

How do I select data between a date range in MySQL. My datetime column is in 24-hour zulu time format.

select * from hockey_stats 
where game_d         


        
8条回答
  •  猫巷女王i
    2020-11-27 15:16

    MySQL date format is this : Y-M-D. You are using Y/M/D. That's is wrong. modify your query.

    If you insert the date like Y/M/D, It will be insert null value in the database.

    If you are using PHP and date you are getting from the form is like this Y/M/D, you can replace this with using the statement .

    out_date=date('Y-m-d', strtotime(str_replace('/', '-', $data["input_date"])))
    

提交回复
热议问题