You are on page 1of 6

DATE FUNCTIONS The date functions are used to manipulate data which appears in Date format 1.

DATEVALUE (date) Gives the serial value of a date. Gives a count of the number of days between Jan 1, 1900 and the given date 2. TODAY() Gives todays date 3. WORKDAY(start_date, #days, [holidays]) 4. How do I determine the number of workdays between two dates? NETWORKDAYS(start_date, end_date, [holidays]) 5. Extract month, year and date from a date Year(date) Month(date) Day(date) 6. Create a Date : DATE(year;month;day)

7. Find the difference between two dates: Datedif(startdate, end date,mode) The start date must be less than or equal to the end date, otherwise it will give an error. Acceptable interval codes are "d", "m", "y", "ym", "yd", "md" (with quotes) It may appear obvious what the "ym", "yd", and "md" interval codes do but they require a second look. The "ym" interval cod yields the number of months between the two dates as if they were in the same year and ignores the year. The "yd", and "md interval codes yields the number of days between the two dates as if they were in the same year and ignores the year.

Date Value: gives the serial value of a date stored as text 6-Jul-2012 41096

WORKDAY:Returns a number that represents a date that is the indicated number of working days before or after a date (the weekends and any dates identified as holidays. Use WORKDAY to exclude weekends or holidays when you calculate invoice d the number of days of work performed. Syntax WORKDAY(start_date,days,holidays) Employee Date of joining Number of days holiday

A B C D

1/12/2012 9/1/2012 8/20/2012

25 -10

To Calculate the net working days between two date. Useful for calculating if daily wages have to be paid Name Amanda Date of joining Date of completion No. of days 1/1/2012 10/31/2012

215

To find which day of the week does a date refer to Date Day 1/1/2012 1

Calculate the time elapsed Emp_name Amanda Beth Peter In time Out time 9:30:00 AM 5:30:00 PM 9:30:00 AM 4:00:00 PM

7. Find the difference between two dates: Datedif(startdate, end date,mode) The start date must be less than or equal to the end date, otherwise it will give an error. Acceptable interval codes are "d", "m", "y", "ym", "yd", "md" (with quotes) It may appear obvious what the "ym", "yd", and "md" interval codes do but they require a second look. The "ym" interval cod yields the number of months between the two dates as if they were in the same year and ignores the year. The "yd", and "md interval codes yields the number of days between the two dates as if they were in the same year and ignores the year.

The start date must be less than or equal to the end date, otherwise it will give an error. Acceptable interval codes are "d", "m", "y", "ym", "yd", "md" (with quotes) It may appear obvious what the "ym", "yd", and "md" interval codes do but they require a second look. The "ym" interval cod yields the number of months between the two dates as if they were in the same year and ignores the year. The "yd", and "md interval codes yields the number of days between the two dates as if they were in the same year and ignores the year.

Emp Name Peter Anne Amit Amanda Samantha

date of birth Date of joining 12/01/87 01/01/12 06/25/76 1/1/2000 03/15/82 12/5/2008 04/04/80 8/1/2005 09/16/67 2/10/2004

Age in years ( on date No. of years of of joining) services as of today

he given date

look. The "ym" interval code the year. The "yd", and "md" nd ignores the year.

7/6/2012

before or after a date (the starting date). Working days exclude hen you calculate invoice due dates, expected delivery times, or

Last working day

9/1/2012

be paid Holidays 1/26/2012 8/15/2012 10/2/2012

No. of hours

look. The "ym" interval code the year. The "yd", and "md" nd ignores the year.

look. The "ym" interval code the year. The "yd", and "md" nd ignores the year.

You might also like