Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
galsaba
 
Posts: n/a
Default How to convert string to a date

I need to do few conversion.
the date in a date field is a string data of this format:
1010230 which indicates 02/30/2001 (101 is 2001)
1051215 indicates 12/15/2005.
How can I convert one to the other?

Also I have
1010230 that I want to convert to a string of YYYYMMDD

and string YYYYMMDD that I want to convert to date format MM/DD/YY

Thanks,

galsaba

  #2   Report Post  
Jason Morin
 
Posts: n/a
Default

For the first 2 dates, use:

=--(MID(A1,4,2)&"-"&RIGHT(A1,2)&"-"&MID(A1,2,2))

By the way, 2/30/2001 is not a real date and the formula
will produce an error.

HTH
Jason
Atlanta, GA

-----Original Message-----
I need to do few conversion.
the date in a date field is a string data of this format:
1010230 which indicates 02/30/2001 (101 is 2001)
1051215 indicates 12/15/2005.
How can I convert one to the other?

Also I have
1010230 that I want to convert to a string of YYYYMMDD

and string YYYYMMDD that I want to convert to date

format MM/DD/YY

Thanks,

galsaba

.

  #3   Report Post  
galsaba
 
Posts: n/a
Default

Then how should i convert it to a real date?

Galsaba

Jason Morin wrote:
For the first 2 dates, use:

=--(MID(A1,4,2)&"-"&RIGHT(A1,2)&"-"&MID(A1,2,2))

By the way, 2/30/2001 is not a real date and the formula
will produce an error.

HTH
Jason
Atlanta, GA

-----Original Message-----
I need to do few conversion.
the date in a date field is a string data of this format:
1010230 which indicates 02/30/2001 (101 is 2001)
1051215 indicates 12/15/2005.
How can I convert one to the other?

Also I have
1010230 that I want to convert to a string of YYYYMMDD

and string YYYYMMDD that I want to convert to date

format MM/DD/YY

Thanks,

galsaba

.


  #4   Report Post  
Peo Sjoblom
 
Posts: n/a
Default

What Jason meant is that there is no February the 30th

--

Regards,

Peo Sjoblom

"galsaba" wrote in message
ups.com...
Then how should i convert it to a real date?

Galsaba

Jason Morin wrote:
For the first 2 dates, use:

=--(MID(A1,4,2)&"-"&RIGHT(A1,2)&"-"&MID(A1,2,2))

By the way, 2/30/2001 is not a real date and the formula
will produce an error.

HTH
Jason
Atlanta, GA

-----Original Message-----
I need to do few conversion.
the date in a date field is a string data of this format:
1010230 which indicates 02/30/2001 (101 is 2001)
1051215 indicates 12/15/2005.
How can I convert one to the other?

Also I have
1010230 that I want to convert to a string of YYYYMMDD

and string YYYYMMDD that I want to convert to date

format MM/DD/YY

Thanks,

galsaba

.




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I convert a number formated as a date to text in Excel? BrotherNov Excel Discussion (Misc queries) 5 March 2nd 05 03:51 PM
extract numbers, convert to date gkaspen Excel Discussion (Misc queries) 7 March 2nd 05 02:31 AM
Convert 20050118 to a working date field Jessica Excel Worksheet Functions 7 February 23rd 05 10:07 PM
convert julian date to gregorian date ammaravi Excel Discussion (Misc queries) 1 December 14th 04 08:17 PM
How do I convert a Julian date into a regular date? Jessica Excel Discussion (Misc queries) 4 December 2nd 04 02:54 AM


All times are GMT +1. The time now is 07:46 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"