224
Views
3
Comments
Get the month from date picker

How do i extract month from the in built date picker and filter data according to months

2023-04-16 15-25-31
Krishnanand Pathak

You can use the Month() function in aggregate filter as shown below. It will filter according to month. As you can see in below filter DateTime is returned from data picker and we extracting month to filter aggregate.



Regards

Krishnanand Pathak


2024-09-12 02-43-38
Deepsagar Dubey

Hi Suraksha ,

As per my assumption for your datepicker you have created an action and bind it on OnChange event, so if you are refreshing your aggregate inside the same  OnChange event,

Pass the input parameter i.e. StartDate in aggregate and inside where clause use Month() built in function it'll give you month of date you have passed,

if you are using refresh aggregate in other action keep selected date in local variable. 

So, you where clause will be look like  Month(YourEntity.DateAttribute) = Month(StartDate) 

You can find complete reference of date time here

I hope it'll help you.

Thanks

Deep

2022-02-25 19-42-59
Srinivas K Singadi
AI Generated

Hello Suraksha Dnyaneshwar Ware

To extract the month from the in-built Date Picker in OutSystems and filter data according to months,  

steps:

  • Create a variable to store the selected date from the Date Picker. For example, you can create a local variable of type Date and name it SelectedDate.
  • In the OnChange event of the Date Picker, assign the value of the SelectedDate variable to the value of the Date Picker.
  • To filter data based on the selected month, you can use the Month() function in your query or filter expression.
This answer was AI-generated. Please read it carefully and use the forums for clarifications
Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.