Guest User

Untitled

a guest
Dec 18th, 2018
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. import datetime
  2.  
  3. class Topclass:
  4. @staticmethod
  5. def main_func():
  6. today = datetime.date.today()
  7. date_string = str(today.year)+"-"+str(today.month)+"-"+str(today.day)
  8.  
  9. @staticmethod
  10. def checkvalue():
  11. try:
  12. conn = pyodbc.connect('DRIVER={SQL Server};SERVER=test.database.windows.net,1433',database='testdb',user='fa',password='sampletest1234')
  13. query = "SELECT people, COUNT(people) as summation FROM dbo.dim_productinformation GROUP by valuecount"
  14. data = pd.read_sql(query,conn)
  15. except:
  16. raise
  17.  
  18. @staticmethod
  19. def tableupdate():
  20. #here I would like to call the 'date_string' variable from main_func() and 'data' from checkvalue()
Add Comment
Please, Sign In to add comment