# How can use the ExecuteSQL for count the time\_out?

**URL:** <https://the.fmsoup.org/t/how-can-use-the-executesql-for-count-the-time-out/3793>\
**Category:** Floating Topics\
**Created:** [November 14, 2023, 6:19am UTC](https://the.fmsoup.org/t/how-can-use-the-executesql-for-count-the-time-out/3793 "2023-11-14T06:19:56Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Saeed](https://avatars.discourse-cdn.com/v4/letter/s/e8c25b/32.png) [@Saeed](https://the.fmsoup.org/u/Saeed)\
**Post date:** [November 14, 2023, 6:19am UTC](https://the.fmsoup.org/t/how-can-use-the-executesql-for-count-the-time-out/3793/1 "2023-11-14T06:19:56Z")

</div>

Hi all,

I wonder if need to create ExecuteSQL for count the time\_out in current month?

regards,

---

<div class="post-metadata">

**Author:** ![MonkeybreadSoftware](https://yyz2.discourse-cdn.com/flex030/user_avatar/the.fmsoup.org/monkeybreadsoftware/32/361_2.png) [@MonkeybreadSoftware](https://the.fmsoup.org/u/MonkeybreadSoftware)\
**Post date:** [November 14, 2023, 6:21am UTC](https://the.fmsoup.org/t/how-can-use-the-executesql-for-count-the-time-out/3793/2 "2023-11-14T06:21:32Z")

</div>

time\_out is a field in your database?

e.g. in SQL:

ExecuteSQL ( "SELECT einDatum FROM Kontakte WHERE Month(CURRENT\_TIMESTAMP) = Month(einDatum) AND Year(CURRENT\_TIMESTAMP) = Year(einDatum)"; Char(9); Char(13) )

einDatum is a date field in the table Kontakte and we look for matching current month and year.

---

<div class="post-metadata">

**Author:** ![Saeed](https://avatars.discourse-cdn.com/v4/letter/s/e8c25b/32.png) [@Saeed](https://the.fmsoup.org/u/Saeed)\
**Post date:** [November 14, 2023, 6:43am UTC](https://the.fmsoup.org/t/how-can-use-the-executesql-for-count-the-time-out/3793/3 "2023-11-14T06:43:44Z")

</div>

> [@MonkeybreadSoftware](#):
>
> ExecuteSQL ( "SELECT einDatum FROM Kontakte WHERE Month(CURRENT\_TIMESTAMP) = Month(einDatum) AND Year(CURRENT\_TIMESTAMP) = Year(einDatum)"; Char(9); Char(13) )

yes,the time\_out is filed in my DB

---

<div class="post-metadata">

**Author:** ![bdbd](https://yyz2.discourse-cdn.com/flex030/user_avatar/the.fmsoup.org/bdbd/32/620_2.png) [@bdbd](https://the.fmsoup.org/u/bdbd)\
**Post date:** [November 14, 2023, 12:54pm UTC](https://the.fmsoup.org/t/how-can-use-the-executesql-for-count-the-time-out/3793/4 "2023-11-14T12:54:47Z")

</div>

You may not need to use SQL for this. You can perform a find for records of the current month, excluding records whose time\_out field is empty. The found set is the number of records that have a time\_out value for the searched month.

---

<div class="post-metadata">

**Author:** ![Saeed](https://avatars.discourse-cdn.com/v4/letter/s/e8c25b/32.png) [@Saeed](https://the.fmsoup.org/u/Saeed)\
**Post date:** [November 14, 2023, 5:36pm UTC](https://the.fmsoup.org/t/how-can-use-the-executesql-for-count-the-time-out/3793/5 "2023-11-14T17:36:40Z")

</div>

I've created the script below, and it's working perfectly. However, during testing, when I change it to the next month, it still gives me the value for the old month. It should return zero.

 ![time_out](https://canada1.discourse-cdn.com/flex030/uploads/fmsoup/original/2X/8/88fffb9a1aa94e95119bc06fb29ec140f798d525.jpeg)

---

<div class="post-metadata">

**Author:** ![bdbd](https://yyz2.discourse-cdn.com/flex030/user_avatar/the.fmsoup.org/bdbd/32/620_2.png) [@bdbd](https://the.fmsoup.org/u/bdbd)\
**Post date:** [November 14, 2023, 6:33pm UTC](https://the.fmsoup.org/t/how-can-use-the-executesql-for-count-the-time-out/3793/6 "2023-11-14T18:33:36Z")

</div>

> [@Saeed](#):
>
> but the dashboard not same the layout include time\_out field

Sorry, I don't understand what you mean by the above.

---

<div class="post-metadata">

**Author:** ![bdbd](https://yyz2.discourse-cdn.com/flex030/user_avatar/the.fmsoup.org/bdbd/32/620_2.png) [@bdbd](https://the.fmsoup.org/u/bdbd)\
**Post date:** [November 14, 2023, 6:42pm UTC](https://the.fmsoup.org/t/how-can-use-the-executesql-for-count-the-time-out/3793/7 "2023-11-14T18:42:58Z")

</div>

Too many details are hidden in your script image. What is the layout where the find is performed? What is the table of this layout? What are the find details?

---

<div class="post-metadata">

**Author:** ![Saeed](https://avatars.discourse-cdn.com/v4/letter/s/e8c25b/32.png) [@Saeed](https://the.fmsoup.org/u/Saeed)\
**Post date:** [November 15, 2023, 6:25am UTC](https://the.fmsoup.org/t/how-can-use-the-executesql-for-count-the-time-out/3793/8 "2023-11-15T06:25:43Z")

</div>

Thank you for following up about my issue, I solved after add criteria month current.
