with SQL resutls containing a certain date, write yes or no

  • Hi all,

    I have a SQL query that I run to get data from a database (Teradata). The criteria is a company ID number. I need to check if they have closed some products with us. There is column called "closed_date" where the date is placed. If the product is not closed, then the date is set as 30/06/2099.
    They could have various products and I need to figure out if they have at least one open.
    I run it from a excel userform where I have a listbox with where I put the id and can run a batch for a lot of them.
    I was wondering how I could change the code and query to give the results like below:

    Customer ID: Closed:
    1234567890 yes
    2739392024 no
    7392873830 no

    Please see the current code I have:


Participate now!

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