Results 1 to 4 of 4
  1. #1
    djclntn is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2011
    Posts
    476

    How to Calculate days of the week

    I have a Table which contains dates & daysof the week. Instead of typing in the day can/how I just type in the date & automatically have the "day" appearin the day field?



    Any assistant would be appreciated!

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    I wouldn't store the day of the week. You can calculate it from the date, using Day(), DatePart(), Format(), WeekdayName(), etc, depending on what you want to see.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    djclntn is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2011
    Posts
    476

    Caan't I have 2-datefieldsin one Table?

    I tried creating another field to display the day of the week -- accordingto the date.

    I used a calculate (Date/Time) Data Type Field & tried this expression:

    WeekdayName([Sunday],[Sun],[Sunday])

  4. #4
    pkstormy's Avatar
    pkstormy is offline Access/SQL Server Expert
    Windows XP Access 2003
    Join Date
    Mar 2010
    Location
    Madison
    Posts
    682
    To get the day, I typically use: Format(Date(),"ddd") for Sun or Format(Date(),"dddd") for Sunday.

    I agree with Paul though and that you probably don't need to store the day value in the table.

    Unless you need it for a specific reason, the day can easily be shown using the above expression in a query or on a form (ie. Format([MyDateField],"ddd")

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

Similar Threads

  1. Replies: 1
    Last Post: 11-12-2010, 01:16 AM
  2. Select Dates between days and two days ago?
    By rstonehouse in forum Queries
    Replies: 4
    Last Post: 08-18-2010, 02:13 AM
  3. calculate no. of working days
    By JOSE LUIS in forum Access
    Replies: 1
    Last Post: 02-01-2010, 03:55 PM
  4. Travel days.
    By emccalment in forum Access
    Replies: 1
    Last Post: 01-06-2010, 05:39 PM
  5. less than 180 days old
    By techexpressinc in forum Queries
    Replies: 2
    Last Post: 06-04-2009, 04: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