Calendar In SQL Query

Experts - Requesting your assistance in building a calendar using SQL Query:

Columns Required
sDate               | Ex: 2015/05/24
sDay                 | Ex: Sunday
sShortDay       | Ex: Sun
sMonth            | Ex: May
sYear                | Ex: 2015
sWkStart          | Ex: 2015/05/18 (Wk should always start in Monday)
sWkEnd            | Ex: 2015/05/24 (Wk should always end in Sunday)
sWkNumber    | Ex: WK 01
sDateQtr          | Ex: Qtr 1 (Jul to Sep - Q1, Oct to Dec - Q2, Jan - Mar - Q3 & Apr to Jun - Q4)

Any query would be helpful
ManjuIT - Project ManagerAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Jim HornMicrosoft SQL Server Data DudeCommented:
The above article (written by me) will handle most of the above..
Eyeball the SET DATEFIRST part to handle on what day weeks start/end.
Spell out for us in greater detail the logic behind week number.

I'm working on a follow-up article that builds on that one, and handles fiscal years where they are different from calendar years, such as Q1 starts in July.  Stay tuned.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Vitor MontalvãoMSSQL Senior EngineerCommented:
Manju, do you still need help with this question?
Active Protection takes the fight to cryptojacking

While there were several headline-grabbing ransomware attacks during in 2017, another big threat started appearing at the same time that didn’t get the same coverage – illicit cryptomining.

ManjuIT - Project ManagerAuthor Commented:
Yes Vitor. I still dont have a sample query for my requirement.
Jim HornMicrosoft SQL Server Data DudeCommented:
Please re-state your question at Barney level what exactly you are trying to pull off here.   After reading the question multiple time it is not clear what you are asking us.

Also note that I have responded in this question, which implies that you should respond back, instead of ignoring and then saying 'I still need help'.

Did you READ the article?  Any comments?
Vitor MontalvãoMSSQL Senior EngineerCommented:
Manju, what for you need a table for that?
DATEPART function give you all that information but the quarter.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server

From novice to tech pro — start learning today.