Nov 18, 2009 #1 R7Dave Programmer Oct 31, 2007 181 US Heelo Is it possible to convert an integer to a date when my data looks like this 60,712 and is supposed to mean... 07/12/06 Is it possible to use CAST or CONVERT to detect this? Is it possible to assign a style? If so, how? Thanks Dave
Heelo Is it possible to convert an integer to a date when my data looks like this 60,712 and is supposed to mean... 07/12/06 Is it possible to use CAST or CONVERT to detect this? Is it possible to assign a style? If so, how? Thanks Dave
Nov 18, 2009 #2 S SkipVought Programmer Dec 4, 2001 47,492 US Hi, I think that your 'number' ought to be a 6-character string: yymmdd in CONVERT Skip, Just traded in my old subtlety... for a NUANCE! Upvote 0 Downvote
Hi, I think that your 'number' ought to be a 6-character string: yymmdd in CONVERT Skip, Just traded in my old subtlety... for a NUANCE!
Nov 18, 2009 1 #3 markros Programmer May 21, 2007 3,150 US something like select cast('200'+cast(myInteger as varchar(5)) as datetime) Upvote 0 Downvote
Nov 18, 2009 #4 bborissov Programmer May 3, 2005 5,167 BG I'm curious how the dates from previous century are presented? Borislav Borissov VFP9 SP2, SQL Server 2000/2005. Upvote 0 Downvote
I'm curious how the dates from previous century are presented? Borislav Borissov VFP9 SP2, SQL Server 2000/2005.
Nov 18, 2009 Thread starter #5 R7Dave Programmer Oct 31, 2007 181 US Hello all Previous Century Example = 910824 I have this working so far... cast(right('0'+cast(MOrigIncep as varchar(6)),6) as datetime) as 'Inception Date', which gives me 2006-07-12 00:00:00.000 does anybody know what I can add to make it... 07/12/06 I know I'm close, thanks for the help Dave Upvote 0 Downvote
Hello all Previous Century Example = 910824 I have this working so far... cast(right('0'+cast(MOrigIncep as varchar(6)),6) as datetime) as 'Inception Date', which gives me 2006-07-12 00:00:00.000 does anybody know what I can add to make it... 07/12/06 I know I'm close, thanks for the help Dave
Nov 18, 2009 Thread starter #6 R7Dave Programmer Oct 31, 2007 181 US Hello - I was able to get it - Thanks again convert(varchar, cast(right('0'+cast(MOrigIncep as varchar(6)),6) as datetime),101) as 'Inception Date' Displays 12/07/2006 ...still looking for 2 digit year Thanks Dave Upvote 0 Downvote
Hello - I was able to get it - Thanks again convert(varchar, cast(right('0'+cast(MOrigIncep as varchar(6)),6) as datetime),101) as 'Inception Date' Displays 12/07/2006 ...still looking for 2 digit year Thanks Dave
Nov 18, 2009 #7 markros Programmer May 21, 2007 3,150 US See http://wiki.lessthandot.com/index.php/Formatting_Dates Upvote 0 Downvote
Nov 18, 2009 Thread starter #8 R7Dave Programmer Oct 31, 2007 181 US Thank you markos - I went to 50 sites and thats the first one Ive seen with mm/dd/yy (everything but) Code: convert(varchar, cast(right('0'+cast(MOrigIncep as varchar(6)),6) as datetime),1) as 'Inception Date', Thanks again Upvote 0 Downvote
Thank you markos - I went to 50 sites and thats the first one Ive seen with mm/dd/yy (everything but) Code: convert(varchar, cast(right('0'+cast(MOrigIncep as varchar(6)),6) as datetime),1) as 'Inception Date', Thanks again
Nov 18, 2009 #9 bborissov Programmer May 3, 2005 5,167 BG Hmmm, There is "Thank markros for this valuable post!" link below markros post Borislav Borissov VFP9 SP2, SQL Server 2000/2005. Upvote 0 Downvote
Hmmm, There is "Thank markros for this valuable post!" link below markros post Borislav Borissov VFP9 SP2, SQL Server 2000/2005.
Nov 18, 2009 #10 markros Programmer May 21, 2007 3,150 US You're welcome, I discovered this page just few days ago myself. Upvote 0 Downvote