Hi John,
Thank you so much for your replies and help. I was able to get the query that I wanted (no error messages!) the only thing I did differently is remove the semicolon at the end of the last line (rank <=1) which may have been due to forum formatting. I should have put a different name for the table so it would not be confusing (I had to rename it due to confidentiality policies at work). The table name shows up as [SCHEMA].TABLENAME, so in the query I referred to the table as
from [SCHEMA].TABLENAME)
Again, thanks for the replies - you've been extremely helpful!