Microsoft Excel - Working With Dates Part 2

In Part 2 of working with dates we use the INT, DAY and WEEKDAY functions to derive the week number within a month for a given date. The following screen shot shows the desired results, assuming a week starts on a Monday:

Wednesday 1st June 2011 is in week 5 of the previous month (May) as the Monday of that week was ion the previous month.

Monday 6th June is in week 1 as it is the first Monday of June.

 

SQL Server - Working with Dates Part 1

Ian & I have received a lot of queries from past delegates about handling various date challenges when extracting data from SQL Server and Oracle databases, so we are adding them to our blog for your reference. There will be a series of posts and this is Part 1.

The following examples are for SQL Server, and are based on the AdventureWorks2014 sample database.

The following queries uses the DATENAME and DATEADD functions.

DATENAME Function

DATENAME can be used to extract a specified part of a date/time value. It takes two arguments: