Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - database dates
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

database dates

 Post Reply Post Reply
Author
cuedog View Drop Down
Groupie
Groupie
Avatar

Joined: 29 December 2001
Location: United States
Status: Offline
Points: 138
Post Options Post Options   Thanks (0) Thanks(0)   Quote cuedog Quote  Post ReplyReply Direct Link To This Post Topic: database dates
    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

Back to Top
Morgan View Drop Down
Groupie
Groupie


Joined: 13 September 2002
Location: United States
Status: Offline
Points: 114
Post Options Post Options   Thanks (0) Thanks(0)   Quote Morgan Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
dpyers View Drop Down
Senior Member
Senior Member


Joined: 12 May 2003
Status: Offline
Points: 3937
Post Options Post Options   Thanks (0) Thanks(0)   Quote dpyers Quote  Post ReplyReply Direct Link To This Post 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

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

 



Edited by dpyers

Lead me not into temptation... I know the short cut, follow me.
Back to Top
cuedog View Drop Down
Groupie
Groupie
Avatar

Joined: 29 December 2001
Location: United States
Status: Offline
Points: 138
Post Options Post Options   Thanks (0) Thanks(0)   Quote cuedog Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
eksimba View Drop Down
Groupie
Groupie


Joined: 23 April 2003
Location: United States
Status: Offline
Points: 48
Post Options Post Options   Thanks (0) Thanks(0)   Quote eksimba Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.