# How to find date difference between datetime and date field

**URL:** <https://community.spicecrm.io/t/how-to-find-date-difference-between-datetime-and-date-field/785>\
**Category:** Uncategorized\
**Created:** [November 3, 2025, 3:57pm UTC](https://community.spicecrm.io/t/how-to-find-date-difference-between-datetime-and-date-field/785 "2025-11-03T15:57:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rsp](https://avatars.discourse-cdn.com/v4/letter/r/4491bb/32.png) [@rsp](https://community.spicecrm.io/u/rsp)\
**Post date:** [November 3, 2025, 3:57pm UTC](https://community.spicecrm.io/t/how-to-find-date-difference-between-datetime-and-date-field/785/1 "2025-11-03T15:57:14Z")

</div>

Is it possible to calculate the date different between datetime and date fields using below CustomFunction? @maretval

> datediff({tc}.DateTime,{tc}.Date)

---

<div class="post-metadata">

**Author:** ![maretval](https://avatars.discourse-cdn.com/v4/letter/m/b38774/32.png) [@maretval](https://community.spicecrm.io/u/maretval)\
**Post date:** [November 3, 2025, 4:20pm UTC](https://community.spicecrm.io/t/how-to-find-date-difference-between-datetime-and-date-field/785/2 "2025-11-03T16:20:46Z")

</div>

> **[W3Schools.com](https://www.w3schools.com/sql/func_mysql_datediff.asp)**
>
> W3Schools offers free online tutorials, references and exercises in all the major languages of the web. Covering popular subjects like HTML, CSS, JavaScript, Python, SQL, Java, and many, many more.

Good luck

---

<div class="post-metadata">

**Author:** ![rsp](https://avatars.discourse-cdn.com/v4/letter/r/4491bb/32.png) [@rsp](https://community.spicecrm.io/u/rsp)\
**Post date:** [November 3, 2025, 4:26pm UTC](https://community.spicecrm.io/t/how-to-find-date-difference-between-datetime-and-date-field/785/3 "2025-11-03T16:26:53Z")

</div>

Thank you, the below query returned correct number of days on the w3schools.

> SELECT DATEDIFF(“2016-06-25 09:34:21”, “2016-06-01”);
