You can use multiple filters on WHERE
, just put AND
among them.
For an interval between two dates, use BETWEEN
.
Remember that dates need to be in quotes and in yyyy-mm-dd format.
Example below:
SELECT *
FROM TABELA
WHERE
status='1'
and data between '2017-01-13' and '2017-01-20';
Note, this if your database field is set to DATE.
If you are on DATETIME, you have to use '00:00:00' for the first date '23:59:59' for the second.
SELECT *
FROM TABELA
WHERE
status='1'
and data between '2017-01-13 00:00:00' and '2017-01-20 23:59:59';
If it is in DATETIME format and you don’t want to worry about putting the time (suggestion by @Bacco):
SELECT *
FROM TABELA
WHERE
status='1'
and DATE( data ) between '2017-01-13' and '2017-01-20';
If it is in TIMESTAMP format, you can use UNIX_TIMESTAMP as suggested by @Inkeliz.
@Bacco, could you help me with a question? http://answall.com/q/177343/31016 At least give me a path... if you can chat, let me know. Or send me a text in the comment.
– Allan Andrade
I left a tip there, I’m on my way out, but if you leave a test in the codepen, it’ll help us try something. Even if I can’t see it today, some colleague might see the link and comment with the hint, and try to help you. I think this one of doing the Chosen separate key event will help. Then in the IF you see if the key is del, and if the element is Chosen. If it is not leave the event quiet pro browser do what you would normally do. if it is, call the method you want. Ai does not even touch the source of Chosen.
– Bacco
I tried Chosen quickly here, and delete erases Abels, but in the fields with text to type delete works normally to delete selection. If you can, then leave a comment here or there later explaining what goes wrong when you try to delete. I tested on FF 50.1.0 on Windows 7
– Bacco