dynamic allocation of a date range (1 Viewer)

jeo

Registered User.
Local time
Today, 14:07
Joined
Dec 26, 2002
Messages
299
Is there a way to dynamically allocate a certain range of days if I know a start day?
I have a form where I have a date called startofproject and I want to allocate all work week days from that start date + 90 days.
I’m assuming it should be some sort of make table query that will delete all data in it and create a whole new range of dates when I run the query again.
Is there a way to do that?
Thanks.
 

godofhell

Database Guru
Local time
Today, 06:07
Joined
May 20, 2005
Messages
180
Jeo, read up on the DateDiff Function, below is an example of what it can do. Note that this function has alot more features that can be set to return different parts of the week, etc. you can also combine this with the Weekday Function to get your results.

DateDiff Function Example
This example uses the DateDiff function to display the number of days between a given date and today.

Dim TheDate As Date ' Declare variables.
Dim Msg
TheDate = InputBox("Enter a date")
Msg = "Days from today: " & DateDiff("d", Now, TheDate)
MsgBox Msg



Weekday Function Example
This example uses the Weekday function to obtain the day of the week from a specified date.

Dim MyDate, MyWeekDay
MyDate = #February 12, 1969# ' Assign a date.
MyWeekDay = Weekday(MyDate) ' MyWeekDay contains 4 because
' MyDate represents a Wednesday.
 

jeo

Registered User.
Local time
Today, 14:07
Joined
Dec 26, 2002
Messages
299
Thanks.
I will look into this.
 

Users who are viewing this thread

Top Bottom