I've decided to edit this for clarity. 

Below is my data with the tables. 

BLDGID, LEASID, STARTDT, and BRK are in table BRKP

OCCPSTAT and SUITID are in another table called STATUS

INCATT is in another table called BILL

```
BLDGID  LEASID  STARTDT BRK OCCPSTAT SUITID INCCAT
  9999  100 8/5/2011    100000  C   AZ847   AVD
  9999  100 8/5/2013    200000  C   AZ847   AVD
  9999  100 8/5/2015    300000  C   AZ847   AVD
  9999  100 8/5/2017    400000  C   AZ847   AVD
  9999  250 12/1/2012   200000  C   BK497   TIL
  9999  250 12/1/2016   400000  C   BK497   TIL
  9999  250 12/7/2020   500000  C   BK497   TIL
  9999  250 1/31/2023   600000  C   BK497   TIL
  7000  987 2/19/2016       0   C   JT127   MTU
  7000  987 5/19/2020   10000   C   JT127   MTU
  7000  987 3/18/2021   20000   C   JT127   MTU
  7000  987 9/4/2023    30000   C   JT127   MTU

```

What I want is to pull ONE row for each suite ID (there are about 100 unique SUITID's per BLDGID). 

In that row, I need the STARTDT to be the highest value BEFORE the date I define. 

If I define 20220831 (08/31/2022) it should pull a single row in this case, that would be row 2. 

If I define 20160831 (8/31/2016) it should pull only row 1. 

I cannot figure out how to get it to pull just 1 row. I can get many. 

I've been trying STARTDT=(max(STARTDT)<'20160831') and other variations.

The issue I'm having with no date entered, it would pull 7/5/2022 but, when I enter my date, it pulls nothing. 

EDIT Again: I've tried adding the below but, it does not change the number of records returned. 

ORDER BY SUITID, STARTDT DESC

SELECT TOP 1 \* FROM SUITID, STARTDT

EDIT FURTHER: Example are first first 4 lines of the table. Expanded to show I'm working with a bigger table.