Re: Milliseconds to date string

2004-11-15 Thread Rafal Kedziorski
hi, At 18:50 12.11.2004, Gleb Paharenko wrote: Hello, Rafal. At first, sorry for my query, it probably should look like this: select convert_tz(cast(from_unixtime(( cast(t as binary) div 1000)) as datetime),'+00:00','-07:00') from tvar; I have to user / instead of div, which maker problems. thx.

Re: Milliseconds to date string

2004-11-15 Thread Johan Hook
Hi Rafal, binary is a reserved word, you need to quote it with back-ticks ` if you want to use it: SELECT s2u.valus as `binary` FROM ... /Johan Rafal Kedziorski wrote: Hi, I get this: "You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the rig

Re: Milliseconds to date string

2004-11-15 Thread Rafal Kedziorski
Hi, I get this: "You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '(cast(from_unixtime(cast(s2u.value as binary) div 1000 ) as dat" I think, the problem is here: select s2u.value as binary from users u,

Re: Milliseconds to date string

2004-11-15 Thread Gleb Paharenko
Hello, Rafal. At first, sorry for my query, it probably should look like this: select convert_tz(cast(from_unixtime(( cast(t as binary) div 1000)) as datetime),'+00:00','-07:00') from tvar; Because you use milliseconds, not seconds. >(cast(s2u.value)) Second... I think you'v

Re: Milliseconds to date string

2004-11-12 Thread Rafal Kedziorski
Hi, If I do this, I get "You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '(cast(from_unixtime(cast(s2u.value)) as datetime), '+00:00', '-" select u.user_id, u.login_name, convert_tz(cast(from_unixti

Re: Milliseconds to date string

2004-11-12 Thread Gleb Paharenko
Hello. The first thing which comes to mind (I didn't dig really deep) looks like: select convert_tz(cast(from_unixtime(cast(t as binary)) as datetime),'+00:00', '-07:00') from tvar; mysql> show create table tvar; +---+--