Returns date for a specified year, month, and day.


DateSerial(year, month, day)


yearInteger expression for year.
monthInteger expression for month.
dayInteger expression for day of month.


  1. DateSerial(2012, 12, 31) 
  2. Following is an example of a calculated member in Time dimension Weekly hierarchy to get all full weeks from the last three months: 

        DateSerial(Year(Now()),Month(Now()) - 3,1),

    DateSerial(Year(Now()), Month(Now()) - 3,1) returns the first date of the month 3 months ago,
    DateSerial(Year(Now()),Month(Now()),-6) returns 7 days before the end of the current month to exclude a week which starts at the end of the last month and ends in the current month; if all weeks which start in the last month despite their end dates should be included, then write 0 instead of -6 - it returns the last day of a previous month.

See also