title: How to modify the input value of a stored procedure with python
body: <p>Currently, I am trying to modify two input values of the following stored procedure that I execute with Python. </p>
  
  <pre><code>country_cursor.execute(
      "[DEV].[DevelopmentSchema].[QA_Extractor] @start_date='2017-05-05', @end_date='2017-05-11'")
  </code></pre>
  
  <p>I do not want to run this program every day and change the start_date and end_date manually from the code but instead trying to create a prompt where I can type down the dates that I want to look for the retrieval. </p>
  
  <p>So far, I have done the following:</p>
  
  <pre><code>end_date   = str(datetime.now()).rpartition(' ')[0]
  start_date = str(datetime.now() - timedelta(days=7)).rpartition(' ')[0]
  
  country_cursor.execute(
      "[DEV].[DevelopmentSchema].[QA_Extractor] @start_date='2017-05-05', @end_date= "+"'"+end_date+"'"+"\"")
  </code></pre>
  
  <p>I just replaced one input date with a variable but when I execute this program I encounter the following SQL error: </p>
  
  <pre><code>pypyodbc.ProgrammingError: ('42000', '[42000] [Microsoft][ODBC SQL Server 
  Driver][SQL Server]An object or column name is missing or empty. For SELECT 
  INTO statements, verify each column has a name. For other statements, look 
  for empty alias names. Aliases defined as "" or [] are not allowed. Change 
  the alias to a valid name.')
  </code></pre>
  
  <p>My point of view is that the Stored Procedure does not accept this variable as the end date, in consequence, the column to look for the retrieval does not exist. I also read in <a href="https://stackoverflow.com/questions/24998586/sql-server-query-erroring-with-an-object-or-column-name-is-missing-or-empty">SQL Server query erroring with &#39;An object or column name is missing or empty&#39;</a> which supports my view. Am I right with my thinking or am I totally wrong? </p>
  
  <p>How can I fix this problem? Any ideas, suggestions and improvements are welcome ;)</p>