I have a transaction table that is used to record data for 4 stores. Each store has a 4 digit store number and each transaction is date coded. I am trying to filter the data based on store code and the month of the transaction date. I can get the filter to work with the store number, but I can't get the syntax right to also filter by transaction month. Following is the set property I am using:
${result.Where(r => r.Deals_StoreNo == 4675)}
I tried using AND a few different ways and can't seem to get the syntax right. Here was my first try.
${result.Where(r => r.Deals_StoreNo == 4675 and MONTH(r.Deals_DealDte)=MONTH(GETDATE()))}
I am looking for the syntax in a "set property" handler. The first syntax I used works, until I try to add a second filter property using "AND". I can't seem to get the syntax right.
I just need help expanding the value to include filtering by two field values. I can make it work on one, but can't seem to write the proper syntax to filter by the second field.
Perfect, that's what I was missing! Followup...the second field is a sql date field...I need to extract the month and filter by the month of the current date...also can't seem to get this data extracted...any help is appreciated.
I have it working to filter by today's date, but can't extract the month. Also when I set this filter, some of the grid filtering options no longer work. I can filter by a single day, but not a range or greater than...is there a way to reset the filter?
Why can't you extract the month? What is the problem?
I am not sure what this means.
You can use >= and <= operators to to compare dates. This however isn't in the scope of Radzen support as it is general .NET / C# programming question.
So I tried this route. Couple issues...doing it exactly like you showed except with a different month. Filters fine on the first filter, but goes blank on the second filter.
You might need to use a date range or ignore any time element that might be present in the column. Also, ensure the dates are comparable e.g. utc or local