Use list in "where col in" clause along with other clauses in mssql query in python
<p>I have 2 lists 
date_list   =  [2016-01,2016-02,2016-01,2016-01]
string_list =  [abc, ghf, rtks]
I need to make a sql query to one of the tables (table1) to retrieve a column data (col1) where col2 is a iteration from list1 and col3 in date_list </p>

<pre><code>for r in string_list:
    elements= ','.join('?' * len(date_list))
    cursor.execute("select col1 from table1 where col2 = ? and col3 in (%s)"r,% elements,tuple(date_list))
    abcd = cursor.fetchall()
</code></pre>

<p>This gives me error. However, if I remove col2 clause from the query, it executes fine. Please help me the add multiple clauses to this query.</p>