Google Custom Search

Sunday, January 16, 2011

Get Details for Month for any given Date

The given script below will give details for a given date as below.

1. First Day of the month along with the Weekday
2. Weekday of the Given date
3. Last day of the month along with the Weekday

Script:

DECLARE @date DATETIME
SELECT @date = GETDATE() --INPUT YOUR DATE HERE
SELECT CONVERT(VARCHAR(25),DATEADD(dd,-(DAY(@date)-1),@date),101) AS DateofMonth,datename(dw,CONVERT(VARCHAR(25),DATEADD(dd,-(DAY(@date)-1) ,@date),101)) as Week_Day,
'First Day of Month for Date Given' AS DayofMonth
UNION
SELECT CONVERT(VARCHAR(25),GETDATE(),101) AS DateofMonth, DAtename(dw,CONVERT(VARCHAR(25),GETDATE(),101)) as Week_Day,'Date Given' AS DayofMonth
UNION
SELECT CONVERT(VARCHAR(25),DATEADD(dd,-(DAY(DATEADD(mm,1,@date))),DATEADD(mm,1,@date)),101) ,DAtename(dw,CONVERT(VARCHAR(25),DATEADD(dd,-(DAY(DATEADD(mm,1,@date))) ,DATEADD(mm,1,@date)),101)) as Week_Day,
'Last Day of Month for Date Given'

Result:

DateofMonth Week_Day DayofMonth
01/01/2011 Saturday First Day of Month for Date Given
01/16/2011 Sunday Date Given
01/31/2011 Monday Last Day of Month for Date Given

Back to Blogging

Life's changes happen so sooner than expected. It was the same period last year that I decided that I should minimize my blogging and professional network to spend more personal time as I anticipated busy personal and professional work.

It's this year that I know that I can spend few hours every week without affecting my personal or professional life, thanks to my understanding family and friends who would like to see me back to those good days. The difference was simple, attitude.

"I am too tired spending time learning, reading and writing. why not take sometime off and feel the personal life?, this was the one for last year and for this year it is "I have a understanding family, friends and people around me to help and keep me happy through my personal life, why not spend some time for the community?"

This difference made things easier for me to start writing back. You will see more and more blogging, discussions and posts from me. Keep me posted if you need anything specific.

At this moment, I would love to say sincere thanks to my understanding PARENTS and WIFE. Encouragement comes from nowhere, it comes from your heart, these are people who live there and that pushes me to move forward quicker.

Monday, November 8, 2010

If these wouldn't have happened

Ten things that had changed my life dramatically.

1. A back injury when I was in 11th grade that kept my away from playing Volley Ball. If I would have continued playing, who knows I would have end up screwing my academics. With help of the injury, I made a better score in 12th Grade and got admitted to one of the best engineering colleges in Tamilnadu.

2. A playful college life that left me among millions of people searching for IT job. But, it was this place that gave me friends for life time.

3. My first job in Covansys, I was moved to Covansys Bangalore along with the entire batch of Freshers and placed in PeopleSoft project. Thanks to the management for putting me in Infrastructure Admin role. My first job was kind of Windows Admin/PeopleSoft DBA.

4. Things changed again forcing move to Quit Covansys and move to Chennai. Got a job in Hexaware, Chennai as PeopleSoft/SQL Server DBA in the internal systems Project. A role that I will remember for lifetime, it was here that I nurtured from an amateur Professional to an expert.

5. An unwanted argument that led me to decide on quitting Hexaware. Thanks to Lord, if this would not have happened I would have still been with Hexaware and would not have been what I am now.

6. Life @ CITIGROUP, a short-lived one but changed the most of my professional career. I have dreamt of being a Microsoft Valuable Professional, it was here that I made friendship with Vidhyasagar and Deepak, both of them are current MVPs to bring something out of us to become one of India's renowned SQL Server MVPs.

7. Help from my Schoolmate Vijay, who guided me to get H1B visa to USA. Again, a lifetime dream that was accomplished with some hurdles here and there.

8. My current job in ThomsonReuters. I am glad to work with expertise SQL Server team and with help of people around me here, I can assure that I would one day realize my dream of seeing me as Vice-President of Operations, IT for some company around this little world.

9. One that often disturbs me now and then, an unexpected surgery to my father that took him out of being in his usual activeness and one that keeps us bothering now and then.

10. Long-awaited one, my marriage as the famous saying goes "In the opinion of the world, marriage ends all, as it does in a comedy. The truth is precisely the opposite: it begins all". We are planning to make the beginning. At the end of road, we wish to hear "Better Half" related to us and Yes, It's "We Wish"