|
Posted by Chris Tate-Davies on 08/02/07 10:11
On 2 Aug, 11:07, Hendri Kurniawan <hckurnia...@gmail.com> wrote:
> Chris Tate-Davies wrote:
> > Hello. I have a generic table used for many different generic
> > functions. the fields are mainly varchar's but one of these varchars
> > contains dates (in the format dd/mm/yyyy) for one reason or another.
>
> > My question is, can I perform a query on this table, using date
> > functions on this varchar field? I.e. search for the latest date?
>
> > Thanks, Chris
>
> Take a look at STR_TO_DATE, and use it like:
> SELECT * FROM table ORDER BY STR_TO_DATE(coldate, '%d/%m/%Y')
>
> Let us know whether it works or not
>
> Hendri Kurniawan
Thankyou Hendri, that works a treat if I convert the field and the
search criteria to date.
Thanks for your help.
Chris.
Navigation:
[Reply to this message]
|