MySQL - query /subquery - issue : I got stuck in creating a subquery in my query (MySQL).

Table name: log2016

Data record started in October and the table looks like:

    | Date                | Temp | Hum | Cond          |
    | 2016-10-01 14:03:40 | 13.6 | 60  | cloudy        |
    | 2016-10-15 00:07:37 | 10.1 | 81  | partly cloudy |
       ...
    | 2016-11-02 13:47:22 | 12.8 | 74  | partly cloudy |
      ...

First of all, I want to select all data from 2016-10-01 00:00:00 until 2016-11-01 00:00:00.

WHERE clause:

    WHERE `Date` < '2016-11-01 00:00:00'

Second I want to select the row "Cond" as follows:

    $query = "SELECT `Cond`, COUNT(`Cond`) AS `Anz` FROM `log2016` GROUP BY `Cond`"; 

This query works fine, but if I put the WHERE clause in this query like e.g.

    $query = "SELECT `Cond`, COUNT(`Cond`) AS `Anz` FROM `log2016` WHERE `Date` < '2016-11-01 00:00:00' GROUP BY `Cond`";

it wont't work.

I googled a lot and also tried different things to solve my problem, but nothing worked.

Can anybody help me with this query/subquery?

Thanks in advance.
