Dear All Precious programmer,

I have a problem in trying to get a list of a date including days in a table start from first day of the month to the last day of the month.
This date should not include the satuday and sunday.
and I should be able to pick up those date for query match.

for example the output should be:

-----------------------------------July---------------------------------
1 2 3 4 5 6 7 8 9 10 11 12........................29 30 31
Thur Fri Mon Tue Wed Thur Fri Mon Fri


Any help would be appreciated.

I thank you very much.

Recommended Answers

All 3 Replies

Show me what you have done so far?

if you have not done anything, show me your pseudo code.

Dear Finito,

Thank you for the reply,

I have use the code below at the moment, which is wrong. is there anyway to fix this.

<%
              
              For LoopDate = -11 To 19
                  vDate = FormatDateTime(DateAdd(DateInterval.Day, LoopDate, Today), DateFormat.ShortDate).ToString
%>
          <td align="center" nowrap colspan="7"><strong><font color="#FFFFFF" face="Verdana, Arial, Helvetica, sans-serif, Tahoma">
            <%
                Response.Write(CDate(vDate).ToString("dd-MM-yyyy"))
            %>
          </font></strong></td>
          <%
            Next

              %>

Thank you very much for helping me

regards

take ref and try fro this code

Dim weekends As var =  New DayOfWeek()
{
	 DayOfWeek.Saturday, DayOfWeek.Sunday 
}

 
 
 
Dim calendarMonth As DateTime =  DateTime.Parse(“10/1/2008″) 
 
 
 
Dim totalDays As Integer =  DateTime.DaysInMonth(DateTime.Now.Year,calendarMonth.Month) 
 
 
 
IEnumerable<int> businessDays = Enumerable.Range(1, totalDays)
 
.Where(d => 
 
Not weekends.Contains(New DateTime(DateTime.Now.Year, calendarMonth.Month, d).DayOfWeek)
 
)
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.