IF (SELECT RentalID FROM claim is not null)'Y' ELSE 'N') as Rental
OK this seems like it should be simple. Seems like I've done this before but for whatever reason its not registering today. I have a query that brings back a lot of data. In the query I want to look at the value (or a lack thereof) of a column called "RentalID". Depending on the value of "RentalID" I want to generate another column called "Rental"
The column called "Rental" will be a yes/no column. If there is a value for rentalID then rental will be equal to "Yes". If rentalID is null or blank then rental will be equal to "No"
How to write? It seems like I need some sort of a subquery or perhaps an exists statement but I cannot seem to find the correct syntax. My query attempt is below. Any help is most appreciated.