N
N
nezzard2016-10-29 17:55:46
SQL
nezzard, 2016-10-29 17:55:46

How to select date from date inclusive to date inclusive?

Good afternoon, I'm trying to select a date from a specific number including that day, to another day including that day, but for some reason it does not take into account the second date
'SELECT * FROM wp_selllist WHERE pay_date >= "2016-10-01" AND pay_date <= "2016- 10-29"'
I need to display both the lines 2016-10-01 and 2016-10-29

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
nozzy, 2016-10-29
@nozzy

On MySQL:
SELECT * FROM wp_selllist WHERE pay_date >= unix_timestamp('2016-10-01 00:00:01') AND pay_date <= unix_timestamp('2016-10-29 23:59:59')

R
romy4, 2016-10-29
@romy4

can you store the date as DATETIME?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question