AboutSyed Rizwan Muhammad Rizvi Expertise I can answers questions regarding web based and desktop based programming in VB.Net. Which can include SOAP, XML, Custom Controls, COM Interoperability etc.
Experience Have been working in this specific area for last 2 years previously I was a VB 6 Developer with experties in other languages as well. Total 10 years of programming experience.
Using Microsoft Access VBA this is what I need to determine: On ODD Number years(2005,2007), the Webnesday folling the first Monday in January.
On Even Number years(2006, 2008), The Wednesday following the first Monday in Febuary and the Wednesday following the first monday in May
Answer here is the pseudo code:
Dim intYear as Integer = Year(Date)
if inYear Mod 2 = 0 then
'Even Year
Dim blnFoundFirstMonday,blnFoundFirstWednesday as Boolean
blnFoundFirstMonday=False
blnFoundFirstWednesday=False
For I as Integer = 1 to 15
Dim dt as Date = DateSerial(intYear,1,I)
If WeekDay(dt)= 2 Then
'1 = vbSunday - Sunday (default)
'2 = vbMonday - Monday
'3 = vbTuesday - Tuesday
'4 = vbWednesday - Wednesday
'5 = vbThursday - Thursday
'6 = vbFriday - Friday
'7 = vbSaturday - Saturday
blnFoundFirstMonday = True
Exit For
End If
If blnFoundFirstMonday Then
If WeekDay(dt)= 4 Then
blnFoundFirstWednesday = True
Exit For
End If
End If
Next
Else
'Odd Year
'Repeate same code like above to find for odd numbers
End If