Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

days of the month

Status
Not open for further replies.

macr0

Programmer
Jan 29, 2000
31
US
What would be the easiest way at going about making a web page display an entire calendar month in a table? This needs to be real/time and not premade. perhaps make a case select for each month and use left(Date, 2) to figure out which month? and then the case decides how many days and in the month? (of course leap year check too). This is going to be a big project and I just wanted a few ideas as to how to go about it before I get started.<br><br>thanks
 
Try using a combination of dateserial, and dateadd. To get to the last day of a month, go to the first day of the month after, then decrease a day. Never fails. <p> <br><a href=mailto: > </a><br><a href= > </a><br>
 
Also check out the functions:<br>&nbsp;&nbsp;Format()<br>&nbsp;&nbsp;FormatDateTime()<br>for help with formatting the returned Date to how you want to display it.<br><br>DateAdd(&quot;d&quot;, 1, dteCurr) would be your best mate though, Use it with a For Loop and your project is nearly complete!<br>(dteCurr can either be a string or a date).<br><br>As far as Leap Years is concerned, Windows itself should handle this if your using the DateAdd command... so you shouldn't need to worry about it. Watch out for Windows Localistation though, it's a double edged sword.<br><br>If you check the return from DateAdd, and then stop when the Month has changed, you can easily control a one screen definition for each month...<br><br>Another useful command maybe DateDiff, which is great for working out Time Left on projects etc.<br><br>Hope this helps...<br> <p>Ben Marshalsea<br><a href=mailto: > </a><br><a href= > </a><br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top