Filtering Report or Union

Important Notice


Please note that on 14th December 2023 users will experience an expected outage whilst we make upgrades to our network. We anticipate this process may take a couple of hours and so we apologise in advance for any inconvenience.

  • So I have an email report from a union query.
    It has

      Firstname,Lastname,Email


    Not all records have an email acount.
    I would like to filter these out. Doesnt matter if they go via the Union or the report. The report would be more optimal because then I could reverse the effect later to see those who do not have an email. But it really doesnt matter how. Thanks in advance.

    [SIZE=2]I should change my name to STUMBED![/SIZE]

  • Re: Filtering Report or Union


    Chris


    I'm not quite following.


    What do you mean by a union query?


    Do you mean a UNION query like this?

    SQL
    SELECT * FROM TABLE1
    
    
    UNION
    
    
    SELECT * FROM TABLE2;


    If you want to exclude empty(null) values use Is Not Null in the criteria.

    Boo!:yikes:

  • Re: Filtering Report or Union


    I arrived at calling it union query because that is what some else called it. But pretty much exactly as you thought. I make a query and then select sql in the corner and placed the commands.
    I have:


    Where should, Is Not Null, be placed? I have tried it every where.

    [SIZE=2]I should change my name to STUMBED![/SIZE]

  • Re: Filtering Report or Union


    Solved.


    I actually found to different methods.
    The one I will use is adding a where line to the sql

    Code
    where emailaddress is not null and emailaddress <> ''


    I was trying it with the is not null only and once I figured this out it was smooth sailing, thanks to Norie for pointing to the right road.


    The second method is kind of neat
    If you right click in the datasheet view in the union query and select
    Filter by form it gives you drop down choices to filter by and creates
    a new query using that filter. Kind of round-a-bout but it worked just the same.

    [SIZE=2]I should change my name to STUMBED![/SIZE]

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!