Hi,
We are creating an app that is connected to an SQL table to look at operator clock in times. The front page allows the user to select a list of operators, on select, it sets a variable and moves to another page that details all the clock in data for that operator (by filtering using the variable).
I want to filter the clock in data based on a date picker: ClockInDatePicker (to only show clock in data for the selected operator on that date), if the date picker is blank, it should show the last 7 x days of clock in data. The clock in date field in SQL is datetime and an example field is: "2023-06-20 07:57:16.307"
I have tried various filters on the gallery, but as soon as there is a filter on date, no records are returned.
The filter on the Items property on gallery I have tried is:
If(
IsBlank(ClockInDatePicker.SelectedDate),
Filter('[dbo].[ClockingLog]', OperatorCode = OperatorVar),
Filter(
'[dbo].[ClockingLog]',
OperatorCode = OperatorVar,
Text(ClockedInTime, "[$-en-GB]dd-mm-yyyy") = Text(ClockInDatePicker.SelectedDate, "[$-en-GB]dd-mm-yyyy")
)
)
If(
IsBlank(ClockInDatePicker.SelectedDate),
Filter('[dbo].[ClockingLog]', OperatorCode = OperatorVar),
Filter(
'[dbo].[ClockingLog]',
OperatorCode = OperatorVar,
Year(ClockedInTime) = Year(ClockInDatePicker.SelectedDate),
Month(ClockedInTime) = Month(ClockInDatePicker.SelectedDate),
Day(ClockedInTime) = Day(ClockInDatePicker.SelectedDate)
)
)
Can anybody help with this?
Many thanks!