I have a dictionary, where I have stored 1000s of Ids and in a set i have few dates.
deliveryDict={} //-->Contains 1000s of IDs, need to be passed in sql to query the DB
timestamp_set = set([]) //-->contains dates
My sql query is like;
sqlstatement = 'SELECT * FROM [dbo].[ObservationData] as obs
where obs.TankSystemId in< IDs from dictionary> and obs.TimeStamp in <date from set>'
cursor.execute(sqlstatement)
How can I pass this to my sql query? I expect my query would be like;
sqlstatement = 'SELECT * FROM [dbo].[ObservationData] as obs
where obs.TankSystemId in (1,2,3,4,5...) and obs.TimeStamp in ('2019-01-01','2019-01-02') '
so my output would be; table of records