List:General Discussion« Previous MessageNext Message »
From:Mahmoud Badreddine Date:March 18 2005 8:55pm
Subject:Re: Converting Integer values to date type
View as plain text  
I got it working , thank you.
I only could do what I wanted to do in multisteps however. I couldn't
figure out the nested querying , and it's bugging me.
Here's how I issued it.
mysql> update tableDummy set newDate=(select
str_to_date('(concat(DayVal,".",MonthVal,".",YearVal))','%d.%m.%Y'));

And although I got an error, it did give all zero values for the
date(e.g 0000-00-00)

no big deal now that I have what I want, but if someone can pick out
my error, would be greatly apreciated.





On Fri, 18 Mar 2005 13:31:14 -0600, Dan Nelson <dnelson@stripped> wrote:
> In the last episode (Mar 18), Mahmoud Badreddine said:
> > Hello,
> > I have a table with separate integer values for the day, month and year.
> > I would like to group them all under one field of type date.
> > I tried a few commands but I haven't captured the right syntax yet.
> >
> > so if the field names are dayVal,monthVal and YearVal in talbeDummy
> >
> > I am doing the following
> > select str_to_date(DayVal.MonthVal.YearVal,'%d.%m.%Y') from tableDummy;
> 
>  CONCAT(DayVal, ".", MonthVal, ".", YearVal)
> 
> --
>         Dan Nelson
>         dnelson@stripped
> 


-- 
-Mahmoud Badreddine
Thread
Converting Integer values to date typeMahmoud Badreddine18 Mar
  • Re: Converting Integer values to date typeDan Nelson18 Mar
    • Re: Converting Integer values to date typeMahmoud Badreddine18 Mar
      • Re: Converting Integer values to date typeMichael Stassen21 Mar