List:General Discussion« Previous MessageNext Message »
From:Mahmoud Badreddine Date:March 18 2005 7:28pm
Subject:Converting Integer values to date type
View as plain text  
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;

I also tried :
select cast('YearVal-MonthVal-DayVal' AS date) from tblDiagnostic;

In both cases I had syntax errors one just flat out didn't run and the
second one gave me Null values in the table.
I also converted the integer values to varchar and that didn't help either.

This is got to be simple to do.
Thanks in advance.
-- 
-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