from datetime import datetime


def compose_delete_from_date(db_alias: str, target_table: str, date_column: str, last_datetime: datetime) -> str:
    """Composes a sql DELETE query to drop old records up to a given date"""
    last_datetime_str = last_datetime.strftime('%Y-%m-%d')
    return f"DELETE FROM {target_table} WHERE {date_column} >= '{last_datetime_str}'"