I tried this and now it worked
query2 ="""insert into table xyz(select * from abc where date_time = %s)"""
cur.execute(query2,(rows))
Though, I don’t know why it worked and how is it different from what I was trying earlier
solved SQL Date Variables in Python