If you are attaching the details choose the Code M first and the short or long terms then add the totals for that.  It was a few days ago I did it...or maybe it was yesterday and just seemed like a few days ago...but the dates are greyed out if I remember correctly.  The IRS will get all the dates and details off the attached PDF of the detailed 1099-B.  Hope this helps and I am remembering it correctly.  It has been a long few days.  My wine is waiting for me patiently.  🤓🍷