Page 1 of 2

Week Numbers of the Year

PostPosted: Mon Oct 24, 2016 6:07 am
by royaltiger
HI
I struggle on formulas and have searched most of the databases, I wanted to add the week number of the year into a database of mine, I have a start date field but would like to know what the formula would be to give me the week number of the year by any given date added. many thanks for helping

Re: Week Numbers of the Year

PostPosted: Fri Nov 04, 2016 1:31 pm
by glenwf
This has been discussed earlier, so just search for "Week of Year" and you will find a very complicated answer and a simple, though not so accurate an answer. That as I recall is simply days of year / 52 = week number of year and then take the whole number.

Re: Week Numbers of the Year

PostPosted: Fri Nov 04, 2016 2:39 pm
by royaltiger
Although I have searched the site , I couldn't find a satisfactory answer or example of how to do the calculation. I do believe its complicated which is why its been difficult to find answer. The iso calculation which says the week begins on a Monday, and Thursday must be in the first week of the year comes into play, Leap years is another factor, when you research, you then realize its complicated, sometimes the first week of the year starts in the last week of December, sometimes there are 53 weeks in the year. I've seen examples of the calculation in other code language but it doesn't fit into the calculated field of Handbase. What would be the closest language code to use in the calculation ?

Re: Week Numbers of the Year

PostPosted: Fri Nov 04, 2016 3:45 pm
by dhaupert
Just a quick search and saw this:

viewtopic.php?f=16&t=3877&p=17185&hilit=week#p17185

Not sure there is a satisfactory answer there but worth a look!

Re: Week Numbers of the Year

PostPosted: Tue Nov 08, 2016 5:28 am
by royaltiger
Ended up taking the easy option, created a database with calendar date and week numbers from excel, made 15 years worth of dates,about 6000 records, imported into database and created a relationship with the date.

Re: Week Numbers of the Year

PostPosted: Tue Nov 08, 2016 6:30 am
by ddhsoftwareadmin
That will do the trick! Perhaps you can share this on the HanDBase Gallery? It seems to come up fairly often on these forums!

Re: Week Numbers of the Year

PostPosted: Tue Nov 08, 2016 8:02 pm
by curtterp
Just uploaded to the Gallery "WeekByDate"

it has 30 years of dates and week of the year

Re: Week Numbers of the Year

PostPosted: Fri Nov 11, 2016 12:45 pm
by glenwf
Sorry, but I can't find "WeekByDate". It isn't in the recent submissions list, nor can if find it with the search engine. Did you withdraw it???

Re: Week Numbers of the Year

PostPosted: Fri Nov 11, 2016 3:38 pm
by uboche
curtterp wrote:Just uploaded to the Gallery "WeekByDate"

it has 30 years of dates and week of the year


Are your week numbers ISO or US American?

Re: Week Numbers of the Year

PostPosted: Fri Nov 11, 2016 10:44 pm
by curtterp
glenwf wrote:Sorry, but I can't find "WeekByDate". It isn't in the recent submissions list, nor can if find it with the search engine. Did you withdraw it???



Sorry

I screwed up the first submission.... didn't see the applet name field...

I have submitted it again and it is showing up in the recent submissions now