Library › Sales AI › Revenue operations

Compute contract end dates and active status in CSV

  • For Revenue operations
  • You practice Asking for a format you can use
  • Time about 5 minutes
  • Level Intermediate

About this exercise

Add end dates to the contracts as CSV in a single code block. Header row exactly: account,start_date,term_months,end_date,active_on_2026_11_06. Dates are ISO (YYYY-MM-DD). The end date is the day before the same calendar day after the term, so a 12-month term starting 2026-01-15 ends 2027-01-14. active is true if 2026-11-06 falls from the start date through the end date, otherwise false. Keep the input order. Outside the code block write at most one line of 12 words or fewer.

Common mistakes when you ask AI for this

  • Off-by-one end dates. The AI ends the term on the anniversary, not the day before. Try: Add: "End date is the day before the same calendar day after the term."
  • Day-first dates. The AI reads 3/1/2026 as 3 January. Try: Add: "Dates are month first; output ISO YYYY-MM-DD."
  • Wrong active flags. The AI marks future or expired contracts as active. Try: Add: "active is true only if 2026-11-06 is from start through end."
  • Wrong header or prose. The AI changes the header or explains at length. Try: Add: "Exact header; one code block; at most one line of 12 words outside it."

What a strong prompt includes

  • Gives the header
  • Defines end date
  • Says ISO and month first
  • Defines active
  • One code block

Practice this now ↑

Related exercises