Results 1 to 5 of 5
  1. #1
    LDarling is offline Novice
    Windows 8 Access 2010 64bit
    Join Date
    Dec 2015
    Posts
    2

    Using Query to select day of week

    Hi,


    First time on here and reasonably new to queries. I have a database and want to run a query that filters the database with two characteristics
    Staff name and
    Day of week.
    So i am after all the database records that involve Rose (staff) and Saturday (Days).
    I have figured how to get Query to show all records with Rose by putting "Rose" in Criteria in the Design View of the Query but I dont know how to get it to show only Saturday records for Rose.

    Thanks for viewing.

    Luke Darling

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    format([date],"w") gives a number
    Saturday = 7
    so use 7 in the criteria and the format in the field.

  3. #3
    vicsaccess's Avatar
    vicsaccess is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Apr 2015
    Posts
    451
    there may be better ways from the experts here but my method would be to format the date as a day of the week in a query then use the criteria field to narrow it down to which day you would like. try expr1:format([productiondate],"dddd")

  4. #4
    LDarling is offline Novice
    Windows 8 Access 2010 64bit
    Join Date
    Dec 2015
    Posts
    2
    Thanks Ranman,
    Just to clarify. With Rose I was able to just put Rose in Criteria Of Staff field but for specific day I need to create new field. So I cant just put in Criteria of Date field?

    Thanks
    Luke

  5. #5
    vicsaccess's Avatar
    vicsaccess is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Apr 2015
    Posts
    451
    Click image for larger version. 

Name:	formatdate.PNG 
Views:	6 
Size:	8.4 KB 
ID:	23198
    you have two options in your query, expression 1 is how ranman described and expression 2 was the way i described.

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

Similar Threads

  1. Replies: 26
    Last Post: 11-05-2015, 01:58 PM
  2. Replies: 9
    Last Post: 06-19-2015, 03:37 PM
  3. Replies: 1
    Last Post: 01-28-2015, 12:19 PM
  4. Replies: 3
    Last Post: 09-19-2013, 10:18 AM
  5. Start a report on week 40 of a week count
    By aspitalnick in forum Reports
    Replies: 8
    Last Post: 11-28-2012, 04:53 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