Results 1 to 3 of 3
  1. #1
    zx3 is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Aug 2011
    Posts
    47

    Red face VBA sql queries to filter out certain days in a week

    I m trying to write a sql query in vba project, only get those records where date is a monday or a wednesday, currently i got something like



    Me.RecordSource = "SELECT * FROM eResult WHERE WeekDay(rdate)='2' OR WeekDay(rdate)='4' ORDER BY eResult.rdate DESC"

    please help to fix the above, thanks.

  2. #2
    lfpm062010 is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2013
    Location
    US
    Posts
    415
    For reading more about it here.
    http://office.microsoft.com/en-us/ac...001228933.aspx

    WeekDay returns a integer value. You don't need the "'".

    Me.RecordSource = "SELECT * FROM eResult WHERE WeekDay(rdate)=2 OR WeekDay(rdate)=4 ORDER BY eResult.rdate DESC"

  3. #3
    zx3 is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Aug 2011
    Posts
    47
    Thanks lfpm062010 , i kind of thinking it would be easy but for the last hour i search the web like crazy thanks again.

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

Similar Threads

  1. Counting Days of the Week
    By losingmymind in forum Reports
    Replies: 10
    Last Post: 12-23-2013, 03:30 PM
  2. Storing Multiple Days of the Week in a Yes/No Format
    By TheMachine in forum Database Design
    Replies: 2
    Last Post: 05-14-2013, 12:46 PM
  3. Filter last day of the week
    By hoachen in forum Access
    Replies: 1
    Last Post: 09-30-2011, 02:06 PM
  4. Form to Filter Report by Week Number
    By jortizz in forum Forms
    Replies: 1
    Last Post: 05-18-2011, 09:30 AM
  5. How to Calculate days of the week
    By djclntn in forum Database Design
    Replies: 3
    Last Post: 02-26-2011, 11:10 PM

Tags for this Thread

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