# how to fetch date from DateTime field in Report Defination

**URL:** <https://forums.pega.com/t/how-to-fetch-date-from-datetime-field-in-report-defination/4655>\
**Category:** User Experience\
**Tags:** reporting, user-experience, pega-platform\
**Created:** [June 19, 2023, 11:30am UTC](https://forums.pega.com/t/how-to-fetch-date-from-datetime-field-in-report-defination/4655 "2023-06-19T11:30:48Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lakshmi\_Priyanka](https://avatars.discourse-cdn.com/v4/letter/l/b19c9b/32.png) [@Lakshmi\_Priyanka](https://forums.pega.com/u/Lakshmi_Priyanka)\
**Post date:** [June 19, 2023, 11:30am UTC](https://forums.pega.com/t/how-to-fetch-date-from-datetime-field-in-report-defination/4655/1 "2023-06-19T11:30:48Z")

</div>

Hi Team,

In Report Definition, I’m filtering the cases by using the pxCreateDateTime property.

I’m using the customised filter section to display the filters. In that section, I am displaying the From and To date fields. So when the user enters the date in that field (for e.g., From: June 15, 2023; To: June 20, 2023), the cases created in between those dates should appear. But pxCreateDateTime, From, and To are datetime properties.

On the UI, I am only capturing the date, not the time. So by default, the system is taking the current time.

The report should not consider the time. It should fetch the records based on the date range. Any help on this would be much appreciated.

---

<div class="post-metadata">

**Author:** ![Pavan\_Bojja](https://yyz2.discourse-cdn.com/pega/user_avatar/forums.pega.com/pavan_bojja/32/23557_2.png) [@Pavan\_Bojja](https://forums.pega.com/u/Pavan_Bojja)\
**Post date:** [June 19, 2023, 12:24pm UTC](https://forums.pega.com/t/how-to-fetch-date-from-datetime-field-in-report-defination/4655/2 "2023-06-19T12:24:55Z")

</div>

@LakshmiPriyankaA

Please try below function for date format

PFA

 ![Day_0.PNG](https://pega1.discourse-cdn.com/pega/original/2X/1/1f08c20ea3cf86fe09213eebfbcb5fe64761c62f.png)

---

<div class="post-metadata">

**Author:** ![Lakshmi\_Priyanka](https://avatars.discourse-cdn.com/v4/letter/l/b19c9b/32.png) [@Lakshmi\_Priyanka](https://forums.pega.com/u/Lakshmi_Priyanka)\
**Post date:** [June 26, 2023, 8:23am UTC](https://forums.pega.com/t/how-to-fetch-date-from-datetime-field-in-report-defination/4655/3 "2023-06-26T08:23:06Z")

</div>

Hi @Pavan Bojja,

That only picks the day value (for example, if the user provided 24/06/2034 1:30 AM, then that function would pick 24 as the day value).

My requitement is to fetch entire Date (like 24/06/2034). Thank you for the quick response

---

<div class="post-metadata">

**Author:** ![Lakshmi\_Priyanka](https://avatars.discourse-cdn.com/v4/letter/l/b19c9b/32.png) [@Lakshmi\_Priyanka](https://forums.pega.com/u/Lakshmi_Priyanka)\
**Post date:** [June 26, 2023, 10:02am UTC](https://forums.pega.com/t/how-to-fetch-date-from-datetime-field-in-report-defination/4655/4 "2023-06-26T10:02:01Z")

</div>

1. I have created two properties: one is a date type (Date1) and another is a date-time type (Date2).
2. I assigned User input to Date1.
3. I am calling one DT to assign this value to Date2 and also appending a time function to Date1.

for eg.,Date2=Date1+@DateTime.time(00,00,00)

1. And passing this Date2 value in RD.

---

<div class="post-metadata">

**Author:** ![NooruddinN](https://avatars.discourse-cdn.com/v4/letter/n/258eb7/32.png) [@NooruddinN](https://forums.pega.com/u/NooruddinN)\
**Post date:** [October 7, 2024, 10:46am UTC](https://forums.pega.com/t/how-to-fetch-date-from-datetime-field-in-report-defination/4655/5 "2024-10-07T10:46:19Z")

</div>

@Lakshmi Priyanka no, the function suggested by @Pavan Bojja will give you the complete date without time value.
