Advertisement
Guest User

Untitled

a guest
Mar 6th, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.53 KB | None | 0 0
  1. def get_number_income_calls(date_from, date_to):
  2.     connection = pymssql.connect(server='oktell-prod.buscom.pro', user='report', password='K&PQu4J)tRu<)q.e', database='oktell')
  3.     cursor = connection.cursor()  
  4.     cursor.execute('''
  5.        select
  6.            *
  7.        from  
  8.            [oktell].[dbo].[Yandex_Call]
  9.        where
  10.            typeCommutation = 1 and
  11.            timeStart >= '{}' and
  12.            timeStart < '{}';
  13.    '''.format(date_from, date_to))
  14.     rows = cursor.fetchall()  
  15.     return len(rows)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement