473,406 Members | 2,549 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Build Date

I need to populate either an array or table with the following date
information. These dates are used to build an effort number based on
what month a records subscription expires.

Drop9_Start: 11/01/04 Drop9_End: 11/30/04
Drop8_Start: 12/01/04 Drop8_End: 12/31/04
Drop7_Start: 01/01/05 Drop7_End: 01/31/05
Drop6_Start: 02/01/05 Drop6_End: 02/28/05
Drop5_Start: 03/01/05 Drop5_End: 03/31/05
Drop4_Start: 04/01/05 Drop4_End: 04/30/05
Drop3_Start: 05/01/05 Drop3_End: 05/31/05
Drop2_Start: 06/01/05 Drop2_End: 06/30/05
Drop1_Start: 07/01/05 Drop1_End: 07/31/05

Basically I want to ask for a date which is the beginning date of a
month, in this example I would input 03/01/05 and based on that I would
want to get the beginning date and ending date of 4 months prior to
03/01/05 and 4 months into the future from 03/01/05. I hope this makes
sense.

Any help would be appreciated.

-Joe

Nov 13 '05 #1
2 2253
Joe Reed wrote:
I need to populate either an array or table with the following date
information. These dates are used to build an effort number based on
what month a records subscription expires.

Drop9_Start: 11/01/04 Drop9_End: 11/30/04
Drop8_Start: 12/01/04 Drop8_End: 12/31/04
Drop7_Start: 01/01/05 Drop7_End: 01/31/05
Drop6_Start: 02/01/05 Drop6_End: 02/28/05
Drop5_Start: 03/01/05 Drop5_End: 03/31/05
Drop4_Start: 04/01/05 Drop4_End: 04/30/05
Drop3_Start: 05/01/05 Drop3_End: 05/31/05
Drop2_Start: 06/01/05 Drop2_End: 06/30/05
Drop1_Start: 07/01/05 Drop1_End: 07/31/05

Basically I want to ask for a date which is the beginning date of a
month, in this example I would input 03/01/05 and based on that I would
want to get the beginning date and ending date of 4 months prior to
03/01/05 and 4 months into the future from 03/01/05. I hope this makes
sense.


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I wouldn't set up a table as you've described, but an array would be OK.

Function assignDates(dteInitial As Date) As Variant
' set up a 2 dimension array
' the 1st dimension has 9 elements for the Drop1-9
' the 2nd dimension has 2 elements: the start date & the end date
Dim dte(0 To 8, 1 To 2) As Variant
Dim i As Integer
Dim dteStart As Date

dteStart = DateAdd("m", -4, dteInitial)

For i = 0 To 8
dte(i, 1) = DateAdd("m", i, dteStart)
dte(i, 2) = DateAdd("m", 1, dte(i, 1)) - 1
Next i

assignDates = dte

End Function

Call this function like this:

dim d() as variant
dim dte as date
dte = #3/1/05#
d() = assignDates(dte)

d(0,1) would be Drop9_Start
d(0,2) would be Drop9_End
d(8,1) would be Drop1_Start
d(8,2) would be Drop1_End
--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQi+FoIechKqOuFEgEQLvxACg5qPGn5cgTUBLMiKnMUkPxB TDvRMAnRbd
dLyeGlXf98f7yb1CqnWrhSUB
=MF2+
-----END PGP SIGNATURE-----
Nov 13 '05 #2
Works great...very good solution.

Thank you

Nov 13 '05 #3

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

Similar topics

3
by: Shawn Wilson | last post by:
Hi, My host keeps messing things up and not telling me. I am trying to write a cron job that will test to make sure the "unusual" functions I use work and, if not, email me. I want it to send...
1
by: nom_du_pere | last post by:
The phpinfo function lists the system ... But is it the system that PHP was compiled on OR the system that PHP is executing on? I took a sneak peek at the source code and I am leaning toward the...
7
by: baylor | last post by:
Is there a way for my EXE to tell when it was built? The idea is to write a copyright date that shows "Copyright 2005-" and then the date the EXE was last built -baylor
3
by: Alice | last post by:
Hi, Does anyone know how to find out the build date & time at runtime? Greatly appreciated. Alice
5
by: cameron | last post by:
Is it possible to get the build date, (not the version), of a dll? -Cam
7
by: dm_dal | last post by:
I have a solution in VS.Net 2003. It contains 1 - asp.net project(c#), 1 - c# class library project and 1 - db project. When I try to build the solution, I get the following error: Could not...
2
by: Roger Helliwell | last post by:
Hey gang, What's the best way to implement a Build version (or "last updated" date) in my web-app? I have a footer in my master page that displays the application's name and copyright info etc....
3
by: nautonnier | last post by:
This may have been covered before but I didn't find anything after doing a google search. Does VS.NET 2005 have a way to put build or version numbers within aspx pages? I'm envisioning an...
2
by: Pieter | last post by:
Hi, How can I knwo the BuildDate from an application distributed by ClickOnce? When I use "System.IO.File.GetLastWriteTime(objAssembly.Location)" or...
7
by: eschneider | last post by:
I have a webservice which every time I build it keeps adding Crystal references into the web.config? <add assembly="CrystalDecisions.Shared, Version=10.2.3600.0, Culture=neutral,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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
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
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.