Results 1 to 2 of 2
  1. #1
    stevekos is offline Novice
    Windows 8 Access 2010 64bit
    Join Date
    Jun 2015
    Posts
    6

    Correct syntax for query expression

    Hello all. I work in a social program which calls clients daily in order to check on their welfare. These calls are made based on both pre-determined call days, and ad-hoc changes based on their changing circumstances. I am currently working on a new database for this service, and particularly a query expression to return a Yes/No value based on a number of conditions.



    - Firstly a condition based on a date range derived from two fields: "NoCallFrom" and "NoCallTo."
    - Secondly a condition based on a multi-select lookup field of days of the week.

    I want my expression to:
    - Based on today's date and day of the week, compare this with the From-To dates and then the values contained in the multi-select lookup field (multi selected for days requiring a call, e.g. Mon, Wed, Fri)
    - and then determine whether the client requires a call based on today's date.

    I have built an IIF expression which successfully deals with the From-To date range, CallToday?: IIf(Date()>=[NoCallFrom] And Date()<=[NoCallTo],"No","Yes") but that's where I am stuck. I am not sure how to construct the rest of the expression. I think that the 'Like' function should feature somewhere there, but that's where my knowledge is exhausted .

    I would appreciate any help you can offer with this.

    Steve.

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,972
    If by multi-select you mean a multi-value field, then LIKE will not be helpful because the data in the field is not a string. Review https://support.office.com/en-us/art...C-6DE9BEBBEC31
    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.

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

Similar Threads

  1. Syntax Error in Query Expression
    By Deggsy in forum Queries
    Replies: 5
    Last Post: 06-03-2015, 08:21 AM
  2. Syntax error in query expression
    By That_Guy in forum Programming
    Replies: 3
    Last Post: 08-17-2012, 09:01 AM
  3. syntax in query expression #ERROR help!
    By manos39 in forum Queries
    Replies: 1
    Last Post: 02-26-2011, 12:21 PM
  4. Syntax Error in Query Expression on filter
    By alaric01 in forum Forms
    Replies: 1
    Last Post: 10-14-2010, 07:23 AM
  5. Syntax error (comma) in query expression
    By KLynch0803 in forum Programming
    Replies: 3
    Last Post: 01-18-2010, 03: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