good point, matt, about the indexability (or rather, lack thereof) of casting a date time value as a string
the function you're thinking of is not TO_UNIXTIME, which would only have made sense (this is mysql, don't forget) but rather UNIX_TIMESTAMP()
but your query won't work anyway, because casting '18-Jul-02' as a timestamp will more than likely get the time 00:00:00 appended to that date
and that's not going to match very many actual timestamps in the table, is it...
so, spaceman, you can also try this --
Code:
select LogSessionID, LogTime
, FROM_UNIXTIME(LogTime,'%d-%b-%y') as LogDate
from yourTable
where LogTime between unix_timestamp('18-Jul-02')
and unix_timestamp('19-Jul-02')
and let us know if it works faster (i.e. uses the index)
Bookmarks