Page 2 of 3 FirstFirst 123 LastLast
Results 16 to 30 of 43
  1. #16
    petes1505 is offline Advanced Beginner
    Windows 10 Office 365
    Join Date
    Nov 2021
    Posts
    34
    Quote Originally Posted by Micron View Post
    Must it remain or can you run an update query to replace it with a space? What happens if you remove it from a couple of records and re-test?
    The data is refreshed weekly, so I am trying to make it as automated as possible. If an update query had to be run for every refresh it would introduce a manual step into the process.

  2. #17
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,412
    The results are totals, not line-by-line detail. When adding the criteria I'm expecting the query to return $800. It's not....it is returning something less than $800.
    so take off the grouping so you can see the line by line detail, find what records are missing, and work out why

  3. #18
    petes1505 is offline Advanced Beginner
    Windows 10 Office 365
    Join Date
    Nov 2021
    Posts
    34
    so take off the grouping so you can see the line by line detail, find what records are missing, and work out why
    There are a bit more than 15,000 lines in the table.

  4. #19
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,791
    If the import is automatic, why can't the update be part of that?
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  5. #20
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,412
    well you won't provide us with anything meaningful so can't suggest anything else.

    You have heard of left joins? so left join your transaction table to the ungrouped query on the PK and find those transaction records that don't have a matching PK. And $1000 seems a very small amount for 15000 records which implies there is something else you are not telling us

    Based on what you have told us, Minty's suggestion way back at post#2 should solve the problem. The fact we are now at post 19 and no further forward means you have not revealed anything else to help us help you.

  6. #21
    orange's Avatar
    orange is offline Moderator
    Windows 10 Office 365
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,722
    Here's a mock up. Hope it's helpful.

    Code:
     ----------------------------------------------------------------
    ' Procedure Name: Nov1021
    ' Purpose: To test Like condition with * within the data
    ' Procedure Kind: Sub
    ' Procedure Access: Public
    ' Author: Jack
    ' Date: 10-Nov-21
    ' ----------------------------------------------------------------
    Sub Nov1021()
              Dim i As Integer
              Dim x(2) As String
    10        x(1) = "ABC*Open Item Inc~"
    20        x(0) = "ABC OPENItem  Inc."
    30        x(2) = " ABC*Closed Item Inc~"
    40        For i = LBound(x) To UBound(x)
    50            If Not x(i) Like "ABC[*]Open Item Inc~" Then
    60                Debug.Print "x(" & i & ")  Is NOT Like " & "ABC Open*Item Inc~"
    70            Else
    80                Debug.Print "x(" & i & ")  Is  Like " & "ABC Open*Item Inc~"
    90            End If
    100       Next i
    End Sub
    With this output:

    x(0) Is NOT Like ABC Open*Item Inc~
    x(1) Is Like ABC Open*Item Inc~
    x(2) Is NOT Like ABC Open*Item Inc~

  7. #22
    petes1505 is offline Advanced Beginner
    Windows 10 Office 365
    Join Date
    Nov 2021
    Posts
    34
    Hello Orange,

    Thank you for the mock up, but I'm confused. What is the purpose and where is this used?

  8. #23
    orange's Avatar
    orange is offline Moderator
    Windows 10 Office 365
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,722
    Sorry had * in wrong position in print out

    edited sub
    Code:
    ' ----------------------------------------------------------------
    ' Procedure Name: Nov1021
    ' Purpose: To test Like condition with * within the data
    ' Procedure Kind: Sub
    ' Procedure Access: Public
    ' Author: Jack
    ' Date: 10-Nov-21
    '  https://www.accessforums.net/showthread.php?t=84768
    ' ----------------------------------------------------------------
    Sub Nov1021()
              Dim i As Integer
              Dim x(2) As String
    10        x(1) = "ABC*Open Item Inc~"
    20        x(0) = "ABC OPENItem  Inc."
    30        x(2) = " ABC*Closed Item Inc~"
    40        For i = LBound(x) To UBound(x)
    50            If Not x(i) Like "ABC[*]Open Item Inc~" Then
    60                Debug.Print "x(" & i & ")  Is NOT Like " & "ABC*Open Item Inc~"
    70            Else
    80                Debug.Print "x(" & i & ")  Is  Like " & "ABC*Open Item Inc~"
    90            End If
    100       Next i
    End Sub
    Result:

    x(0) Is NOT Like ABC*Open Item Inc~
    x(1) Is Like ABC*Open Item Inc~
    x(2) Is NOT Like ABC*Open Item Inc~

    Purpose to show Not Like with an "*" embedded in the data/target string

    Putting [ ] around the *.

  9. #24
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,114
    Sorry to ask but isn't Not Like "ABC[*]Open Item Inc~" similar to <> "ABC*Open Item Inc~"

    With like I always use a wildcard character, otherwise it acts like an equal sign, does it not?

    So shouldn't the criteria be Not Like "ABC[*]Open Item Inc~" & "*" to eliminate those records that start with that specific string?

    Cheers,
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  10. #25
    orange's Avatar
    orange is offline Moderator
    Windows 10 Office 365
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,722
    @vlad
    I agree.
    I can substitute this for the not like and get same results
    50 If x(i) <> "ABC*Open Item Inc~" Then
    or
    50 If Not x(i) = "ABC*Open Item Inc~" Then
    But you then have to remove the [ ] surrounding the *.

  11. #26
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,412
    the implication from the OP is 'ABC*Open Item Inc~' is in the description field rather than description field = ABC*Open Item Inc~. - so examples (asked for but not provided) might be 'ABC*Open Item Inc~123' or '123 ABC*Open Item Inc~' or '123 ABC*Open Item Inc~ xyz'.

    If indeed it is = (or<>) we have all been going up the wrong path for the last 6 hours

  12. #27
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,114
    @ Ajax - my understanding was that the description field has records that start with 'ABC*Open Item Inc~' as you describe. That's why I suggested the addition of the wildcard character after it (& "*") that was missing in the first posts.

    Cheers,
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  13. #28
    petes1505 is offline Advanced Beginner
    Windows 10 Office 365
    Join Date
    Nov 2021
    Posts
    34
    Everyone,

    I appreciate the help....truly do, and the last thing I want to do is waste anyone's time. Nobody has been going down the wrong road. Here is what is known:

    1. There is a payables table with 15,000 lines plus that is refreshed weekly
    2. Within that table there are multiple columns, one of them being Description in unformatted text which includes information about the payment (added by a third-party)
    3. There is a specific string of text that appears in the Description field that I want the query to ignore, and in each case the string begins with ABC*Open Item Inc
    4. The query result is a sum total of the amount paid of all of the lines, not a line listing
    5. When using Not Like "ABC*Open Item Inc" as the criteria, the query is ignoring any line that includes any of the words listed in the criteria. For example, if a line includes the word Open, the query ignores that line. That is the best example I can provide.
    6. I've tried other variations, including <>, placing brackets [] around the *, adding &"*" to the end of the query, and in each case the query is ignoring data other than what I am looking for it to ignore.

    When this began I thought it would be an easy question; what is the criteria for telling Access to ignore a line if a specific field begins with ABC*Open Item Inc

    Thanks,
    Pete

  14. #29
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,114
    Pete, have you had a chance to look at my sample, here it is again. I do not get the same results, so maybe show us the query in design view at least.

    Cheers,
    Attached Files Attached Files
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  15. #30
    petes1505 is offline Advanced Beginner
    Windows 10 Office 365
    Join Date
    Nov 2021
    Posts
    34
    Hi Gicu,

    Yes, I did. I downloaded and did a copy/paste of the criteria just to make sure I wasn't making any keying errors. The same result as when I typed it in earlier.

    I think it has something to do with using the term Not Like. I mentioned earlier that when I use the term Like "ABC*Open Item Inc" and run the query, it pulls up the exact information. The query pulls up only those lines that begin with that string. When I use Not Like "ABC*Open Item Inc" the query returns data that does not contain any of the string rather than just the entire specific string.

    Just to be clear, when I say when I use the term Like "ABC*Open Item Inc" and run the query, it pulls up the exact information what I mean is it pulls the exact lines I am trying to have the query ignore if I use Not Like.

Page 2 of 3 FirstFirst 123 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 13
    Last Post: 06-12-2020, 08:31 AM
  2. Extract specific text from very long string
    By csmith in forum Queries
    Replies: 24
    Last Post: 03-03-2017, 09:25 AM
  3. Replies: 6
    Last Post: 05-29-2015, 10:21 AM
  4. Trying to find a value right of specific string with in text
    By weilerda in forum Import/Export Data
    Replies: 2
    Last Post: 10-18-2012, 12:58 PM
  5. Replies: 13
    Last Post: 07-05-2012, 10:33 AM

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