INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login




Remember Me
Forgot Password?
Join Us!

Come Join Us!

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

Join Tek-Tips
*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.
Jobs from Indeed

Link To This Forum!

Partner Button
Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

produce day of week from date

produce day of week from date

(OP)
is their a function that I can use to get the day of week based on a date?

Example:

I input 6/29/2006 and it would say Thursday

NameOfFunction(6/29/2006)

If not how would I go about creating such a function??

Newbie in search of knowledge

RE: produce day of week from date

Format(#6/29/2006#,"dddd")

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886

RE: produce day of week from date

(OP)
I tried

CODE

weekday(6/29/2006)


but it produced 7 which stands for Saturday

but when I put

CODE

weekday(6/29/2006,vbTuesday)

it gives me 5 which stands for Thursday

what can I put in the second argument that it automatically gives be the correct day without editing the code each year?



Newbie in search of knowledge

RE: produce day of week from date

Have you tried my suggestion ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886

RE: produce day of week from date

(OP)
PHV thanks that worked we posted at the same time thus I missed your idea

Newbie in search of knowledge

RE: produce day of week from date

The syntax

CODE

weekday(6/29/2006,vbTuesday)
Tells the system that Tuesday is the first day of the week so the numbering then becomes

1 = Tuesday
2 = Wednesday
:
5 = Saturday
6 = Sunday
7 = Monday

The default for the second argument is vbSunday with the numbering

0 = Sunday
1 = Monday
:
6 = Friday
7 = Saturday

Unless you have good reason for changing the day on which a week starts, just omit the second argument.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

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:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close