Results 1 to 4 of 4
  1. #1
    Bagels is offline Novice
    Windows 10 Access 2016
    Join Date
    Feb 2023
    Posts
    22

    Using a wildcard in a count function

    I'm trying to use a wildcard (*) in a count function and it's not working.

    =Count(IIf([FailureMode]="Manufacturing Defect" And [ProductWithinWarranty]=True,0))
    Works fine

    =Count(IIf([FailureMode]="Component*" And [ProductWithinWarranty]=True,0))


    Does not work, returns 0

    The query the report is based on shows all the failure modes. For components, it's "Component- ABC", "Component- XYZ", etc. etc.
    So i'm trying to count all the "Component_____" failures by using the wildcard, obviously i'm doing something wrong.

  2. #2
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,940
    Either use Left(FailureMode,9)="Component"
    or Like "Component*"

    You cannot use = with *

    After all it is not equal to what you are asking.


    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  3. #3
    Bagels is offline Novice
    Windows 10 Access 2016
    Join Date
    Feb 2023
    Posts
    22
    Thank you very much. All it was was a stupid "=" sign .

  4. #4
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,940
    Please mark as solved then.
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

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

Similar Threads

  1. Replies: 17
    Last Post: 09-12-2020, 01:28 AM
  2. Wildcard in directory Dir function
    By JeroenMioch in forum Access
    Replies: 7
    Last Post: 04-30-2015, 08:10 PM
  3. Using a wildcard with the replace function
    By razkowski in forum Queries
    Replies: 6
    Last Post: 08-12-2014, 08:13 AM
  4. Replies: 9
    Last Post: 12-05-2013, 11:48 AM
  5. COUNT Group Count Records COUNT FUNCTION
    By PMCOFFEY in forum Access
    Replies: 9
    Last Post: 11-09-2012, 09:40 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