Smart questions
Smart answers
Smart people
Join Tek-Tips Forums
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 now!
  • 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.

vttech (TechnicalUser) (OP)
29 Jun 06 15:15
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

Helpful Member!  PHV (MIS)
29 Jun 06 15:28
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

vttech (TechnicalUser) (OP)
29 Jun 06 15:33
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

PHV (MIS)
29 Jun 06 15:35
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

vttech (TechnicalUser) (OP)
29 Jun 06 16:07
PHV thanks that worked we posted at the same time thus I missed your idea

Newbie in search of knowledge

Golom (Programmer)
2 Jul 06 11:38
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!

Back To Forum

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