List:General Discussion« Previous MessageNext Message »
From:Christian Mack Date:August 3 1999 3:24pm
Subject:Re: Inserting dates in dd/mm/yy form..
View as plain text  
Patric de Waha wrote:
> 
> Hi,
>         I live in Luxemburg (europe) and we are used to this form dd/mm/yy.
> 
>         I use www-sql which has no string manipulation functions,
>         which means I've no possibility to change the input
>         date (dd/mm/yy) to the yy/mm/dd which mysql expects.
> 
>         Ok now can do that?!
> 
>         insert into tblpersons dtbirthdate values
> (CONVERT_IT_FOR_PATRIC('04/08/79'));
> 
>         I m looking for something like that :)
> 
> Regards,
>         Patric de Waha

Hi Patric

You have two choices:
1) Write an UDF that does the translation.
2) Use this (slow) INSERT:
INSERT INTO 
	table 
SET 
	dateColumn=CONCAT( 
			RIGHT('04/08/79', 2)
			, '-'
			, SUBSTRING('04/08/79', 4, 2)
			, '-'
			, LEFT('04/08/79',2) )

Tschau
Christian

Thread
Inserting dates in dd/mm/yy form..Patric de Waha2 Aug
  • Inserting dates in dd/mm/yy form..sinisa2 Aug
  • Re: Inserting dates in dd/mm/yy form..Christian Mack3 Aug