LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   mysql query with unix timestamp (https://www.linuxquestions.org/questions/linux-newbie-8/mysql-query-with-unix-timestamp-816765/)

kirukan 06-28-2010 04:56 AM

mysql query with unix timestamp
 
Quote:

select * from s_transaction Where between UNIX_TIMESTAMP('2010-06-28 15:40:00') and UNIX_TIMESTAMP('2010-06-28 16:00:00') and user_id = '15545941';
Is this the syntax correct to retrieve a particular user transaction between given time period? Please help me because "its return error check the syntax near the between"

druuna 06-28-2010 05:15 AM

Hi,

Shouldn't that be:

select * from s_transaction
where timestamp between UNIX_TIMESTAMP('2010-06-28 15:40:00') and UNIX_TIMESTAMP('2010-06-28 16:00:00')
and user_id = '15545941';


Hope this helps.

kirukan 06-28-2010 05:22 AM

Thanks a lot Druuna, Yes I correct it

druuna 06-28-2010 06:06 AM

You're welcome :)


All times are GMT -5. The time now is 01:23 AM.