INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
• Talk With Other Members
• Be Notified Of Responses
• Keyword Search
Favorite Forums
• Automated Signatures
• Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

#### Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

# Date minipulation

## Date minipulation

(OP)
Having trouble figuring this one out. I know it can't be too hard but I don't think I've had enough coffee yet this morning.

My problem is, I have a date field [StartDate] in the format "7/31/2016 9:26:12 PM". If that date is a Sunday (which is easy to determine), I need to make that date the following morning at 7am or "8/1/2016 7:00:00 AM". I can't figure out how to programatically change the date.

Any ideas?

Any help and assistance is greatly appreciated.

Michael

It is said that God will give you no more than you can handle. I just wish God didn't think I was just a bad ass.

### RE: Date minipulation

Hi,

Assuming that [StartDate] is a real date...

#### CODE

NextDay = DateSerial(Year([StartDate]), Month([StartDate]), Day([StartDate])+1) + TimeSerial(7,0,0)

Skip,

Just traded in my OLD subtlety...
for a NUance!

### RE: Date minipulation

(OP)
Thanks a ton Skip.

Michael

It is said that God will give you no more than you can handle. I just wish God didn't think I was just a bad ass.

### RE: Date minipulation

Skip's example adds a day to the value of [StartDate] no matter what day of the week it is. Use the WeekDay function with vbSunday to determine if it is Sunday and then run his code if it is.

### RE: Date minipulation

Hmmmmmmm????

"I have a date field [StartDate] in the format "7/31/2016 9:26:12 PM"
"I need to make that date the following morning at 7am"

Turns out, the date that the OP has is a Sunday.

Straining at a gnat?

Skip,

Just traded in my OLD subtlety...
for a NUance!

#### Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

#### Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Close Box

# Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

• Talk To Other Members
• Notification Of Responses To Questions
• Favorite Forums One Click Access
• Keyword Search Of All Posts, And More...

Register now while it's still free!