searching between dates in MYSQL in this format 03/17/10.11:22:45

Posted by Kelso on Stack Overflow See other posts from Stack Overflow or by Kelso
Published on 2010-03-17T15:48:14Z Indexed on 2010/03/17 15:51 UTC
Read the original article Hit count: 302

Filed under:
|
|

I have a script that automatically populates a mysql database with data every hour. It populates the date field like 03/17/10.12:34:11 and so on.

I'm working on pulling data based on 1 day at a time from a search script.

If i use

select * from call_logs where call_initiated between '03/17/10.12:00:00' and '03/17/10.13:00:00'

it works, but when I try to add the rest of the search params, it ignores the call_initiated field.

select * from call_logs where caller_dn='2x9xxx0000' OR called_dn='2x9xxx0000' AND call_initiated between '03/17/10.12:00:00' and '03/17/10.13:00:00'

^-- I x'd out a couple of the numbers. I've also tried without the between function, and used >= <= to pull the records, but have the same results. Im sure its an oversight, thanks in advance.

© Stack Overflow or respective owner

Related posts about mysql

Related posts about datetime