How to change the date format


image

Hi, I want to filter data based on the date selected by the user. I have already changed the date format to display only the date, but the time still appears. Is there something wrong with the settings?

On the layout section does the time still show?
It shouldn’t

Also, I think the reason that is is because the input/form component you used is the Date and time component not the date alone.

I use only the date

The column type is Date & Time. The value always includes a time component, regardless of how it was entered or how you choose to display it.

That said, you should be able to filter against a user-supplied date by using “is within”.

If your filter isn’t working, please show us how you have set it up, and the data.

hi darren I managed to use “is within” but I have another problem, now I have a start date and an end date, the expected result is that the data that I filter with the start and end dates does not exceed the date I chose, for example I chose the start date 2 October 2024 and the end date is 10 October 2024 with “is within” I can only filter these two dates, the expected result is between these dates following the date I chose.
To select it I use if then else

  • Add two Single Value columns to your table
    – The first single value column should target the Start Date
    – The second single value column should target the End Date
  • This should give you the entered start and end date in every row. You can now compare those against the actual date in each row using an if-then-else column:
    – If Date is before Start Date, then null (leave empty)
    – If Date is after End Date, then null
    – Else true
  • Any rows that fall within the two dates will be checked in the if-then-else column

Another approach is to use a Query column. Add it to the same table that captures your Start/End dates, target it at your data table, and apply the following filters:

  • Date is on or after This row->Start Date
  • Date is on or before This row->End Date

Then use the Query column as the source of your Chart/Collection.

1 Like


Hi Darren, I’ve followed your advice, I’m trying to filter October 1 2024 to October 4 2024, but if than else only selects from October 1 to October 3, how can I get the 4th selected?

Most likely there is a time component in either the End Date or Date columns that is causing this.

This is where I would probably convert all dates to integers and do numerical comparisons instead of date comparisons. This eliminates the time issue.

So for each of your Date, Start Date & End Date add a math column using the following:

Year(Date)*10^4
+Month(Date)*10^2
+Day(Date)

That will give you a number for each something like 20241013.
Then use those integer values in your Single Values and if-then-else columns.

1 Like


I’ve done the math, so now do I have to use “equals”? or other?

  • If Date is less than Start Date, then null
  • If Date is greater than End Date, then null
  • Else true

(referring to the math columns in all cases above)

1 Like

Thank you @Darren_Murphy , @micheal
Thanks to you I have achieved what I hoped for…
once again thank you very much…

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.