473,493 Members | 2,254 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How to get date correponding to 2nd wednesday of each month.

How to get date correponding to 2nd wednesday of each month.

Mar 27 '06 #1
2 1094
Ok, I got it myself..
If Today.DayOfWeek < DayOfWeek.Wednesday Then
dt2ndWednesday = DateAdd("d", (DayOfWeek.Wednesday -
Today.DayOfWeek) + 7, Today)
ElseIf Today.DayOfWeek > DayOfWeek.Wednesday Then
dt2ndWednesday = DateAdd("d", 14 - (Today.DayOfWeek -
DayOfWeek.Wednesday), Today)
End If

Mar 27 '06 #2
Without trying to understand what the code means I can tell you that it will
fail on Wednesdays:-)

If you don't know what I mean, you will be abl eto test it soon. Follow the
logic when today.dayofweek = dayofweek.wednesday.

Renze de Waal

In article <11**********************@e56g2000cwe.googlegroups .com>,
am********@gmail.com wrote:
Ok, I got it myself..
If Today.DayOfWeek < DayOfWeek.Wednesday Then
dt2ndWednesday = DateAdd("d", (DayOfWeek.Wednesday -
Today.DayOfWeek) + 7, Today)
ElseIf Today.DayOfWeek > DayOfWeek.Wednesday Then
dt2ndWednesday = DateAdd("d", 14 - (Today.DayOfWeek -
DayOfWeek.Wednesday), Today)
End If

Mar 28 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
5197
by: androtech | last post by:
Hello, I'm looking for a function that returns a date range for a specified week number of the year. I'm not able to find functions like this anywhere. Any pointers/help would be much...
3
1867
by: amit.gaind | last post by:
Please suggest how to get date correponding to 2nd wednesday of each month ?
5
8790
by: cbalian | last post by:
I am looking for a TSQL code that would calculate a specific date each month that varies based on the following condition: I need the result that would return the date of the Thursday after the...
16
4428
by: W. eWatson | last post by:
Are there some date and time comparison functions that would compare, say, Is 10/05/05 later than 09/22/02? (or 02/09/22 format, yy/mm/dd) Is 02/11/07 the same as 02/11/07? Is 14:05:18 after...
0
7119
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
6989
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...
1
6873
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7367
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...
0
5453
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4579
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3088
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3078
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1400
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.