Click here to Skip to main content
15,900,108 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
Hi,

i am having a student attendance record which will display single or entire class attendance. The thing is if i need to have the total no of days a guy is present i can deduce from total working days with present days(in database). I am having a combo box for which i am giving the month names eg: if its march it should get as 31 but if i get feb the prob arises with the leap year. how to solve this Kindly give me some suggestions.
My OP contains: 1.No of days in that month
2.Absent days. 3. Present days.
Posted
Updated 1-Jun-12 3:30am
v2
Comments
Zoltán Zörgő 1-Jun-12 9:13am    
How exactly did you imagine this? How could you tell from "march" if it is a leap year or not? Give an example please!
[no name] 1-Jun-12 9:14am    
How is it Possible????????????????????????
Jackie00100 1-Jun-12 9:14am    
dont get it... what is it you want? your question seems very wierd?
Sunasara Imdadhusen 1-Jun-12 9:55am    
Good joke :)

there's no way to determine whether its a leap year or not, without knowing the year.
 
Share this answer
 
Basic answer is no. The year is the only indicator of if you are in a leap year. Leap year is only ever fourth year so the month wouldn't indicate anything of value in relation to the year.
 
Share this answer
 
Your question is not very clear. The short answer is no, you need the year.
If you start with a year that is a leap year, such as 1904, and you know the number of months that have passed you can determine if there has been a multiple of 4 years. However, every 4 years is not a completely accurate way to determine if it is a leap year. See this link[^] for a complete explanation of how to calculate the leap year.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900