query for filtering published posts?

You can add this to the WHERE clause, just after your filter by post_date:

AND post_status = "publish"

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)