Print Page | Close Window

database dates

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Database Discussion
Forum Description: Discussion and chat on database related topics.
URL: https://forums.webwiz.net/forum_posts.asp?TID=5009
Printed Date: 30 March 2026 at 3:54am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: database dates
Posted By: cuedog
Subject: database dates
Date Posted: 13 August 2003 at 8:42pm

I am wanting to know if anyone has an example of a database to show how you can make a daily entry for each day of the year. Example(hit counter)

Or if someone can give an explanation on how I would make my field entries for the tables




Replies:
Posted By: Morgan
Date Posted: 14 August 2003 at 7:29pm

Do you want a table in a database to have one row for each day of the year?  (366 rows)

or

Do you want to have a table to accumulate daily entries?  (unlimited umber of rows)

or

Something else?



-------------
Morgan


Posted By: dpyers
Date Posted: 15 August 2003 at 7:55pm

You'll want to make a database based upon Julian dates - the three digit number of days since January 1st of the year.

Example of using ASP and Julian dates is at

http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=7627&lngWId=4 - http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=7627&lngWId=4

You'll need a db with 366 entries and have to include some logic for handling leap years.

 



-------------

Lead me not into temptation... I know the short cut, follow me.


Posted By: cuedog
Date Posted: 15 August 2003 at 10:08pm
I want the table to accumulate daily entries, I want to be able to add up weekly and monthly entries


Posted By: eksimba
Date Posted: 16 August 2003 at 12:35am

I'd make a "Date Dimension" table, with one record for each day of the year. Then, you have a field for each additional attribute you want to track. In your case, they would be Week_No and Month, but you could also add other attributes later if you wish, like Day_Of_Week, Weekend (Yes/No), Holiday (Yes/No), Fiscal_Quarter, etc. etc.

Link your entry table to the Date table using the date field, and you can easily add up the entries by week, month, quarter, day of week, or anything else you'd like to track.



-------------
- eric



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net