Results 1 to 2 of 2
Thread: Week Caculations (All)
2004-02-17, 03:42 #1
- Join Date
- Feb 2004
- Hastings, Hawke's Bay, New Zealand
- Thanked 0 Times in 0 Posts
Week Caculations (All)
my database needs to record data by WEEK Number. I was using an integer and this worked fine, but now the year has changed and i didn't think that far ahead!
The user wants to enter the week number (integer) and see the result as an integer.
I am not sure of the best way to do this?
a/. -Use Hidden year to calculate from?
b/. -Convert Week integer to a Date and store this, Then have to convert back to week number for dispaly?
Any suggestions greatly appreciated.
2004-02-17, 04:41 #2
- Join Date
- Aug 2001
- Evergreen, CO, USA
- Thanked 64 Times in 63 Posts
Re: Week Caculations (All)
I presume that your user doesn't want data from 2003 week X mixed in with data from 2004 week X - at least most users wouldn't want that. So you need a unique identifier, whether it is the year or some other identifier. I suppose you could always calculate the week based on a beginning date of say 1/1/2000, and then the week number would be an integer that continued, adding 52 weeks for some years, and 53 for others, but it would get pretty messy. I would use a true date/time field for each record, and then calculate a value for the week number, using the DateDiff() function for any reports or other analysis.Wendell