473,394 Members | 1,748 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Given a year how can i find mounths with 5 sundays in it?

Given a year how can i find mounths with 5 sundays in it?

Example input:2011
output:jan n feb
Dec 24 '10 #1
1 1257
Rabbit
12,516 Expert Mod 8TB
Math and common sense suggests that there are only 14 scenarios. 7 for non-leap years and 7 for leap years. Each one based on what day of the week a year starts on. Further analysis may consolidate some scenarios or reveal a pattern. It's time for you to get out a calendar.
Dec 24 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: J. Muenchbourg | last post by:
I'm trying to get the date from a request-query post that contains a year (request("season") and a week number from that year (cint(request("gameweek"))+35) I added 35 to the week number because...
9
by: Chris | last post by:
Is there a way to make python create a list of Mondays for a given year? For example, mondays =
3
by: dik mus | last post by:
Hi, I connect to a database that only stores the year and weeknumber. But i need the date of the corresponding monday. This could be more difficult as one expect because the weekumbers might...
0
by: Lee Harr | last post by:
I wrote a function to return the first date of a given week (and a few related functions) : -- return the first date in the given week CREATE or REPLACE FUNCTION week_start(integer, integer)...
2
by: Chad Richardson | last post by:
I would like a single SQL to return all employee's total billable compensation for a year. Their billable rates change throughout the year so under the employee table (one), there is a compensation...
22
by: Kd | last post by:
I have the following set up to give me aresponse number R05-001 I would like it to reset to R06-001 at new year ResponseNo: "R" & Right(Format(Date(),"yyyy"),2) & "-" & Format(,"000") This is...
1
by: ibiza | last post by:
Hi all, I need to find a specific, for example the third friday of a given month/year. How to do that? thanks :)
2
by: jai80 | last post by:
hi frenz, I want to display all the dates and day of the given year and month. For ex; if i choose 2007 and select the month January, i want to generate all the dates for this selection ...
1
by: digidave | last post by:
I am keenly aware that my coding skills are extremely noob but please indulge me a second.. Take a look at these queries.. $sql = "SELECT DISTINCT year FROM _current_floats_config WHERE active =...
3
by: =?Utf-8?B?cm9kY2hhcg==?= | last post by:
hey all, is there a way if you are given a Year and a Week an easy way to go back say 26 weeks ago from given year/week. for example, given: 2008/16 26 weeks prior is: 2007/43 thanks,
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.