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 8813709
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T03:55:35+00:00 2026-06-14T03:55:35+00:00

I could use some help deriving a year quarter from a text string that

  • 0

I could use some help deriving a year quarter from a text string that represents a date. I have a string, say ‘20121230’, to represent 12/30/2012. Somehow, someway, I need to convert this value into ‘4Q12.’ I get stuck after converting the 20121230 into a date:

CONVERT(date,datestringfield,111)

I need help deriving the quarter and year from this date and then converting the quarter and year to a string format 4Q12. Any help would be greatly appreciated

  • 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-14T03:55:37+00:00Added an answer on June 14, 2026 at 3:55 am

    If you are using SQL Server, then the particular format of datestringfield can be used as a date unambiguosly. So, you can do:

    SELECT  DATENAME(QUARTER,datestringfield) + 'Q' + 
            RIGHT('00'+DATENAME(YEAR,datestringfield),2)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a SQL question that I could use some help with. Still somewhat
I could use some help creating an XSL template that will take a string
I have a piece of code here that i really could use some help
I could use some help with a RIA services query that I have been
I could use some help with expression conversion. I have a method on a
i have an issue i could use some help with, i have python list
I could use some pointers on my query I have three external tables that
I could use some help with this. I have to get list of files
I could use some help with the syntax for datalist control which I have
I could use some help. How can I delete words in a string within

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.