Results 1 to 10 of 10
  1. #1
    Coors is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2011
    Posts
    7

    Weekday Name from a Date

    I am relatively new to Microsoft Access, so I hope this question makes since. I am building a query and in one column it has a date span. When I run the query it returns the date ie. 5/03/2011. 5/03/2011 is a Tuesday. I want the next column in my query to say "Tuesday"

    I have tired 'Expr1: WeekdayName(2)" to tell it the first day of the week is Monday, but then every day 5/03/2011, 4,5,6, 7th etc of May is Monday.


    How do I write a formula so it returns the day of the week based on the date in another column.

    Thanks,

  2. #2
    Coors is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2011
    Posts
    7
    Ok, I've tried this
    Expr1: WeekdayName([Issue_Dt],False,2)
    and when I run the query I get "#Func!" What am I doing incorrectly?

  3. #3
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Have you looked up WeekDayName() in help for the syntax?
    WeekdayName(weekday, abbreviate, firstdayofweek)

    The WeekdayName function syntax has these parts:

    PartDescription

    weekday Required. The numeric designation for the day of the week. Numeric value of each day depends on setting of the firstdayofweek setting.

    abbreviate Optional. Boolean value that indicates if the weekday name is to be abbreviated. If omitted, the default is False, which means that the weekday name is not abbreviated.

    firstdayofweek Optional. Numeric value indicating the first day of the week. See Settings section for values.

  4. #4
    Coors is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2011
    Posts
    7
    Quote Originally Posted by RuralGuy View Post
    Have you looked up WeekDayName() in help for the syntax?

    Yes, and thats how I came up with Expr1: WeekdayName([Issue_Dt],False,2)

    Not sure what is wrong, I'm listing the columnn I want evaluated "Issue_Dt", Saying False, so no abreviation apprears, and stating "2" that Monday is the 1st day of the week.

  5. #5
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Except the 1st argument of the function needs to be a number from 1 to 7, not a date.

  6. #6
    Coors is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2011
    Posts
    7
    Quote Originally Posted by RuralGuy View Post
    Except the 1st argument of the function needs to be a number from 1 to 7, not a date.
    How does it know what date to look at if you don't tell it what column to pull from?

    If I do Weekday([Issue_date],2) it returns the correct number, but when I do weekdayname([Issue_date],2) it won't.

  7. #7
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Try putting those two functions together:
    WeekdayName(Weekday([Issue_date])).

  8. #8
    Coors is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2011
    Posts
    7
    Quote Originally Posted by RuralGuy View Post
    Try putting those two functions together:
    WeekdayName(Weekday([Issue_date])).

    That worked!! Thanks.
    I could get it to spit out numbers, but not the right day. Thanks for the help.

  9. #9
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    You're welcome. Glad we could help. I marked the Threrad as Solved for you.

  10. #10
    boblarson is offline --------
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    1,272
    And just as an alternative method (which is sometimes just as easy):

    Format([Issue_date], "dddd") will yield the same thing.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Convert date to weekday overview
    By LarsBoer in forum Forms
    Replies: 3
    Last Post: 09-14-2011, 07:25 AM
  2. Replies: 1
    Last Post: 07-07-2010, 04:22 PM
  3. Weekday excluding weekends
    By jd316632 in forum Queries
    Replies: 3
    Last Post: 05-24-2010, 02:01 PM
  4. Individual weekday count in a month
    By Silver_A in forum Queries
    Replies: 6
    Last Post: 04-16-2010, 08:14 PM
  5. Replies: 1
    Last Post: 12-09-2005, 10:29 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums