Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

need help with dates

Status
Not open for further replies.

devinci

MIS
Feb 15, 2002
46
0
0
CA
Hi...I want to be able to display a list of all the person that are suppose to start on the next Monday. Let say that I click on the report today, I want to print all the people that are going to start on Monday and during that week.

Hope somebody will be able to help...Thanks

 
I am not sure what you are after. I am going to assume that you need to calculate next monday's date based on what day it is today. From next mondays date you can get the dates for the remainder of the week. I am also going to assume that getting the information from your database is not a problem. Correct me if I am wrong.

Below is what I would use to get specific dates based on today. It is simple and there is probably a better way but it works.

Dim Weekday as string, NextMonday as Date

Weekday = Format(Date, "dddd")
Select Case Weekday
Case "Monday"
NextMonday = Date + 7
Case "Tuesday"
NextMonday = Date + 6
...
End Select

Obviously you will need to finish the select statement with the remaining days. When you have next mondays date, then next the rest of the week is

Tuesday = NextMonday + 1
Wednesday = NextMonday + 2
etc...

Hope this helps. Thanks and Good Luck!

zemp
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top