# Weird alert behavior

**URL:** <https://community.grafana.com/t/weird-alert-behavior/34716>\
**Category:** Alerting\
**Tags:** alerting\
**Created:** [August 5, 2020, 8:55pm UTC](https://community.grafana.com/t/weird-alert-behavior/34716 "2020-08-05T20:55:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![andreacfm](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/andreacfm/32/10930_2.png) [@andreacfm](https://community.grafana.com/u/andreacfm)\
**Post date:** [August 5, 2020, 8:55pm UTC](https://community.grafana.com/t/weird-alert-behavior/34716/1 "2020-08-05T20:55:04Z")

</div>

I have a metric defined like:

```
 SELECT
  $__time(created_at),
  1 as value
FROM table_name
ORDER BY 1 DESC
LIMIT 100

```

The points are correctly displayed in the chart. When I define an alert and use a condition like:

count () - query(A,12h,now) - IS BELOW 1

No matter what timeframe I define in query I always get 100 as result and the alert will never trigger even if I have no points in the last 12h.  
Any suggestion?
