Results 1 to 9 of 9
  1. #1
    sergran is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Jun 2013
    Posts
    115

    problemi con query


    Hello, I have a problem with a query. I have a table that contains the field Review. I created a query to filter only the records that contain the data, but this does not happen ... In fact, some records in the result is also empty.
    We carry the sql query
    Lista_cd.Recensione Lista_cd SELECT FROM WHERE (((Lista_cd.Recensione) Is Not Null)) OR (((Lista_cd.Recensione) Not Like ""));
    The Memo field is
    thanks
    Hello

  2. #2
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    Try changing your "OR" to "AND" in your SQL code.

  3. #3
    sergran is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Jun 2013
    Posts
    115
    Hello, thanks for the reply .. in fact I tried it that way but nothing to do

  4. #4
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    It works fine for me when I test it. Are you sure that field is blank? If you apply the LEN function to that field in a query, does it return zero or some other number, i.e.
    Code:
    Length_Check:LEN(Lista_cd.Recensione)
    BTW, how you wrote the SQL in your original post looks a little funny, It should look like this (after the OR is switched to AND).
    Code:
    SELECT Lista_cd.Recensione 
    FROM Lista_cd
    WHERE (((Lista_cd.Recensione) Is Not Null)) AND (((Lista_cd.Recensione) Not Like ""));

  5. #5
    sergran is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Jun 2013
    Posts
    115
    Query.zipHello, nothing to do .. I can not understand where is the error. I enclose the db
    thanks

  6. #6
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    I do not have the ability to download files from my current location (corporate policy), but I can look at it tonight (in about 12 hours) when I am at home, if no one else here looks at it before then.

    Did you try the recommendation I gave in my previous post? What did it return for the Length of these fields?
    If it is returning 0 for all the ones you want to exclude, maybe try this code:
    Code:
    SELECT Lista_cd.Recensione 
    FROM Lista_cd
    WHERE LEN(Lista_cd.Recensione)<>0;
    Note: I had a few small typos in the SQL code I posted in my previous post that I have since corrected.

  7. #7
    sergran is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Jun 2013
    Posts
    115
    Unfortunately for me the same problem .... I do not understand .... however, I do not rush ... when you can download the db please ...

  8. #8
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    Where did the data that is in that Memo field come from? It looks like it contains some special characters (so it is NOT blank). Did you copy it off of the Web or something?
    It looks like it contains some formatting code.

    Take a look at the following SQL code changes I made to your query (just change your Query to SQL View, and cut and copy this code in that window, then view the results):
    Code:
    SELECT Lista_cd.Recensione, Len([Lista_cd]![Recensione]) AS Length_Check, Left([Lista_cd]![Recensione],Len([Lista_cd]![Recensione])) AS Actual_Entry
    FROM Lista_cd
    WHERE (((Lista_cd.Recensione) Is Not Null And (Lista_cd.Recensione) Not Like "" And (Lista_cd.Recensione) Not Like ""));
    Note the Length_Check calculated field I added is checking the length of your "Recensione" field. Note how it is not zero.
    So, my "Actual_Entry" is return the actual value in that field, and you can see that none are blank. It looks like they have some formatting or HTML code included. That is what is causing your issues.

  9. #9
    sergran is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Jun 2013
    Posts
    115
    Thank you very much ... in fact symbols that were present but not seen, and even selecting them were not. But with your query I solved the problem. thanks again

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

Similar Threads

  1. problemi con Evento
    By sergran in forum Programming
    Replies: 8
    Last Post: 08-22-2013, 01:58 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