Scott Lock

Thoughts on .Net, Caparea.net and Windows Phone


News

My Stats

  • Posts - 77
  • Comments - 127
  • Trackbacks - 21

Tag Cloud


Recent Comments


Recent Posts


Archives


Post Categories


Image Galleries


Blogs I Read


Microsoft MVP


User Groups


 

I ran accross a field in a flat file yesterday that was in the format of "CCYYDDD". Now I can only assume that "CC" means century, but that's not the point. The actual value was "2008294". I needed to write an expression that converted the year and day of year format to a standard date. Here's the expression to do this (thank you to Ed Buhain for brainstorming): DATEADD("d", ((DT_I4)SUBSTRING(Date, 5, 3) - 1), (DT_DATE)("1/1/" + SUBSTRING(Date, 1, 4))) Where "Date" is the value you need to convert....
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati