Skip to content

Instantly share code, notes, and snippets.

@dafma
Created August 17, 2017 16:57
Show Gist options
  • Save dafma/422114be15874d665761f603594f3b8c to your computer and use it in GitHub Desktop.
Save dafma/422114be15874d665761f603594f3b8c to your computer and use it in GitHub Desktop.
El máximo, mínimo rango de fecha
sql2 = "Select DATEPART(week,MIN(FechaEntrega)) as SemanaDelYear from Compra where Mov in('Pedido', 'Pedido Excedente') and Estatus='PENDIENTE'"
cursor = connection.cursor()
cursor.execute(sql2)
minsql = cursor.fetchall()
minsql = minsql[0].SemanaDelYear
maxsql = maxsql[0].SemanaDelYear
my_list = list(range(minsql, maxsql))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment