Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9003757
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T00:45:07+00:00 2026-06-16T00:45:07+00:00

I have string ’12B17T’ which represents exactly YYMDDA ( A is an irrelevant attribute).

  • 0

I have string '12B17T' which represents exactly YYMDDA (A is an irrelevant attribute).
For months, 1-9 is used for January to September; A-C is used for October, November, and December

The size of this string is fixed (e.g. if the date is January 1, 2012, it will look like '12101T')

How do I get something like 17.11.2012 from this using SQL?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T00:45:08+00:00Added an answer on June 16, 2026 at 12:45 am

    Try this;

    DECLARE @x varchar(50)= '12B17T' 
    SELECT  SUBSTRING(@x,4,2) +'-'+ 
       RIGHT( '0' + CASE SUBSTRING(@x,3,1) WHEN 'A' THEN '10'
                              WHEN 'B' THEN '11'
                              WHEN 'C' THEN '12' 
       ELSE SUBSTRING(@x,3,1) END, 2) +'-'+ 
       '20' + SUBSTRING(@x,1,2)
    

    SQL Demo Fiddle here

    --Results 17-11-2012        
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have string which i have to display in TextBlock, my TextBlock have some
I have string which rich text content something like this for example <p>Hello</p> <br/>
I have string strInfo, which contains Employee John Maybach. How do I make the
I have string which contains either A ,B, C, or D (example A123 or
I have string containing many of HTML tag of exactly that construction: Hello <img
I have string that is in format January 1, 2008 how can I parseExact
I have string which has a fix length of 14... and the string consist
I have string which is storing only 1's and 0's .. now i need
I have string which contains something about amount 3 val 6, amount 7 val
I have String variable which contains date. Now how to display July 15 from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.