August 28, 2013 at 8:46 am
Hello everyone, I am very new to this forum but came across many good forum posts so I decided to join. My question is with regard to having an embedded date in a string and converting this to a date. I have a serial number like the following "GA0120100466" where the "GA" is not needed and really only the next six digits represent the date. So I can use the MID function and the LEFT function to extract "012010" without any trouble. Problem is I would like to convert this to a date so that I can calculate the age for example. So the date should be "01/20/10". Any help on this would be greatly appreciated. I also have some charting issues that I need to sort out at some point so if this is not the correct forum for inserting charts into SSRS reports let me know please.
Paul
August 29, 2013 at 8:13 am
= FORMAT(DATESERIAL(LEFT(MID("GA0120100466",7),2),LEFT(MID("GA0120100466",3),2),LEFT(MID("GA0120100466",5),2)),"MM/dd/yy")
- Susan
September 3, 2013 at 12:53 pm
Susan, thank you for your help. Worked like a charm!
Paul Bond
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy