Jump to content

Date Format MS SQL Server 2000 to MySQL


numan82

Recommended Posts

hi to all,

I am having little problem with Date Format, actully I am reading data from MS SQL Server 2000 and inserting into the MySQL.

The Date format of SQL Server 2000 is like 19990120 and MySQL accept the date in the format of

YY-MM-DD,

I tried several function but could not get the solution, I also tried the implode function but it is not working.

any help

thanks in Advance...

Numan

Link to comment
Share on other sites

You can insert a yyyymmdd value directly into a mysql DATE data type -

 

9.3.1. The DATETIME, DATE, and TIMESTAMP Types ...

As a string with no delimiters in either 'YYYYMMDD' or 'YYMMDD' format, provided that the string makes sense as a date. For example, '19970523' and '970523' are interpreted as '1997-05-23', but '971332' is illegal (it has nonsensical month and day parts) and becomes '0000-00-00'.

 

or

 

As a number in either YYYYMMDD or YYMMDD format, provided that the number makes sense as a date. For example, 19830905 and 830905 are interpreted as '1983-09-05'.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.