Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Days in a month count

Status
Not open for further replies.

thaan

MIS
May 10, 2004
3
US
Hello again all. I am trying to create a metric that will count the number of days in a month. Any help would be appreciated
 
What part of this are you finding difficult? Please be more specific. From reading what you posted, I don't see how this can be more then a count metric filtered on Month.
 
Sorry I was vauge. I am trying create a dynamic count of day in a month that takes into exception holidays.
 
This doesn't seem to be different from your other post on Business Day Metric. Same logic should work here also. You can have a simple flag called BusinessDay in your Date table. The flag will have 2 values, 1 for BusinessDay and 0 For NonBusinessDay. NonBusinessDay will be set for Holidays and Sundays. After this is set, it is a count of date filtered on BusinessDay flag set to 1.

The BusinessDay flag should satisfy both your posts on the date metrics.
 
Most DB have a day of week or similar date functiosn. In the case of Teradata, you can join to the calendar view in the sys_calendar database:

sel * from sys_calendar.calendar where calendar_date='2004-05-15';

Will give you day of week (7):

calendar_date day_of_week day_of_month day_of_year day_of_calendar weekday_of_month week_of_month week_of_year week_of_calendar month_of_quarter month_of_year month_of_calendar quarter_of_year quarter_of_calendar year_of_calendar
2004-05-15 7 15 136 38121 3 2 19 5445 2 5 1253 2 418 2004
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top