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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Setting Future Dates - Question

Status
Not open for further replies.

saw15

Technical User
Jan 24, 2001
468
US
Working with asp, a client wants to enter an order. Rules are as follows:

If date = 25th or less (1/1 - 1/24 but for current month) then effective date of order = 1st of next month (2/01/03).

If date = 25 or greater (1/25 - 1/31) then effective date of order = 3/1/03 (skip a month).

But, if the 25th falls on the weekend (Sat or Sunday) then that Friday prior to weekend (date of 1/23 or 1/24) should show an effective date 3/1/03 (skip month).

The first part is easy enough using Day etc, but its the 25th falling on a weekend that has stumped me a little.

Any suggestions appreicated.
 
you have the date 2/25/2003. I think you can use

DatePart("w", "2/25/2003")

Result
1 -> Sunday
....
7 -> Saturday
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top