Hello,

 

I have been pulling my hair out trying to get a SELECT statement to work
using a range of Unix timestamps as the criteria.

 

MySQL Version 4.0

 

SELECT FROM_UNIXTIME(time) FROM srvlog WHERE FROM_UNIXTIME(time >=

'1080948600') AND FROM_UNIXTIME(time <= '1080997876');

 

I also tried this too:

 

SELECT FROM_UNIXTIME(time) FROM srvlog WHERE FROM_UNIXTIME(time >=

'1080948600' AND FROM_UNIXTIME(time <= '1080997876')); //Change the
parenthesis to make one evaluation. Same result.

 

 

This query returns all rows and does not stop at the '<=' parameter of
1080997876. Even when I get this working, how do I display the output in
the FROM _UNIXTIME(time, '%b %m %h:%m......etc)  so I can control the
way the date appears after the Unix time comparison has taken place?

 

The time field is int(11) and this works the same on Linux and Windows
so it is not an issue with the OS or the environment (unless I am
missing something simple). I have read the MySQL Date and Time page but
not quite found what I am looking for. Any help would be greatly
appreciated.

 

 

Many thanks,

 

 

Craig.

 

 

Reply via email to