* zxcv
> Our programming crew does not give us (Web Services) access to Oracle. We
> of course don't care kuz' mySQL suits us fine. But now we have run into a
> pickle. They are handing us text cdf files for import. One of the fields
> they are giving us is in the following condition:
>
> 02-SEP-02
>
> We need to do a conversion of that to a `real' datetime format. I know of
> a function in php that will convert that but I need this in SQL only.
>
> Any ideas?

Asuming all dates are 20xx:

mysql> select
@d:='01-DEC-18',@d2:=concat('20',mid(@d,1,2),'-',field(mid(@d,4,3),
'JAN','FEB','MAR','APR','MAY','JUN','JUL','AUG','SEP','OCT','NOV','DEC'),'-'
,mid(@d,8,2)) as converted, @d2 + interval 1 second as proof;

--
Roger


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to