Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    316854 is offline Advanced Beginner
    Windows 7 64bit Access 2013
    Join Date
    Mar 2013
    Posts
    44

    Convert date to day of week

    I want a column to have the date and the column to the right of it to show the day of the week.



    I'm a complete Access newbie.

    I know how to do this in excel.

    How do I do this in Access?

    I'm not familiar with VBA.

  2. #2
    rzw0wr is offline I will always be a newbie
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2013
    Location
    Indiana
    Posts
    479
    Are you talking about a table, Form,Query or a report.

    This is untested.
    WeekDayName(Weekday(date,FirstDayOfTheWeek),Abbrev iate,FirstDayOfTheWeek)


    Dale

  3. #3
    316854 is offline Advanced Beginner
    Windows 7 64bit Access 2013
    Join Date
    Mar 2013
    Posts
    44
    table ddddddddddddddddddddddddd

  4. #4
    316854 is offline Advanced Beginner
    Windows 7 64bit Access 2013
    Join Date
    Mar 2013
    Posts
    44
    I'm not sure what this means:

    This is untested.

    WeekDayName(Weekday(date,FirstDayOfTheWeek),Abbrev iate,FirstDayOfTheWeek)

  5. #5
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,958
    Here are some examples of expressions that manipulate date value using intrinsic date/time functions. http://support.microsoft.com/kb/210604

    Also http://www.alvechurchdata.co.uk/accdate.htm
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  6. #6
    316854 is offline Advanced Beginner
    Windows 7 64bit Access 2013
    Join Date
    Mar 2013
    Posts
    44
    i didn't explain my request clearly enough.

    in excel i use this:

    =TEXT(A3, "ddd")

    what's the equivalent of this in access?

    This is what i'm looking for:
    Sun
    Mon
    Tue
    Wed
    Thu
    Fri
    Sat

  7. #7
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    in excel i use this:

    =TEXT(A3, "ddd")

    what's the equivalent of this in access?
    FORMAT([DateField],"ddd")

  8. #8
    316854 is offline Advanced Beginner
    Windows 7 64bit Access 2013
    Join Date
    Mar 2013
    Posts
    44
    "The expression Format([DateField],"ddd") cannot be used in a calculated column."

  9. #9
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    Quote Originally Posted by 316854 View Post
    "The expression Format([DateField],"ddd") cannot be used in a calculated column."
    Where are you trying to do this?

    You should be able to use this formula in a calculated field (expression) in a Query, or on a Report, i.e.
    Code:
    DayofWeek: FORMAT([DateField],"ddd")

  10. #10
    316854 is offline Advanced Beginner
    Windows 7 64bit Access 2013
    Join Date
    Mar 2013
    Posts
    44
    Click to Add
    Calculated Field
    Date/Time
    Paste into Expression Builder box
    OK
    "The expression Format([DateField],"ddd") cannot be used in a calculated column."

  11. #11
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    Quote Originally Posted by 316854 View Post
    Click to Add
    Calculated Field
    Date/Time
    Paste into Expression Builder box
    OK
    "The expression Format([DateField],"ddd") cannot be used in a calculated column."
    You need to substitute the actual name of your field where it says [DateField].

  12. #12
    316854 is offline Advanced Beginner
    Windows 7 64bit Access 2013
    Join Date
    Mar 2013
    Posts
    44
    The title of the column is "Date"

    FORMAT([Date],"ddd")
    "The expression Format([Date],"ddd") cannot be used in a calculated column."

    FORMAT(Date,"ddd")
    "The expression Format([Date],"ddd") cannot be used in a calculated column."

  13. #13
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    You should NEVER use reserved words like "Date" as field names. It could confuse Access, as it could either mean the Function "Date" or the Field "Date".

    I am guessing that you are using a newer version of Access, and are trying to add this on the Table level. In older versions of Access, this was not possible. It was not possible to do calculations on the Table level. The had to be done on the Query or Report level. Many experienced DB programmers (including myself) would advise you to continue this trend, and not try to perform any calculations right within the table itself.

  14. #14
    316854 is offline Advanced Beginner
    Windows 7 64bit Access 2013
    Join Date
    Mar 2013
    Posts
    44
    I started using Access only after subscribing to Office 2013.

    How do I make a query or report to show the result of the expression?

  15. #15
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    Wow, so you are really starting at the very beginning here with Access.

    Creating simple Select Queries are one of the most fundamental and basic tasks to do in Access, and one of the main reasons to use Access.
    Any introduction book will show you how to build simple queries in Access, as will many, many places on line (just do a Google Search on "create select query in Access").
    Here is one link with an online tutorial: http://office.microsoft.com/en-us/tr...CTT=1&client=1

    Once you see how to do that, check out "creating a calculated field or expression in an Access query".

    On-line books and tutorials will do a much better job explaining it that I ever could, as they have the benefit of visual aids.

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. convert date to calender week
    By snoopy in forum Queries
    Replies: 6
    Last Post: 10-29-2012, 08:07 AM
  2. Adding the day of the week to a date field
    By cschieff in forum Reports
    Replies: 2
    Last Post: 10-24-2012, 02:47 PM
  3. Replies: 3
    Last Post: 04-01-2012, 01:40 PM
  4. Group by Week for any given start date
    By royalrochelle in forum Queries
    Replies: 3
    Last Post: 02-15-2012, 08:44 PM
  5. how to convert week number to date range
    By qwang1115 in forum Access
    Replies: 1
    Last Post: 02-13-2009, 11:35 AM

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