I have a couple of tables where I need to be able to place some filters and run a query. The problem is, I can't think of an easy way to group it.
Filters:
- Date Range
- User ID's (needs to be grouped if multiple)
Groupings on date column:
- Daily (no grouping required)
- Weekly
- Monthly
- Quarterly
- Yearly
I have figured that I could dump everything without grouping into a DataTable and go from there, but the code got ugly really quickly, and I haven't even tackled trying to group the result by userID.
Is there an easier way I can do this with SQL, or am I stuck with manipulating the DataTable?
Filters:
- Date Range
- User ID's (needs to be grouped if multiple)
Groupings on date column:
- Daily (no grouping required)
- Weekly
- Monthly
- Quarterly
- Yearly
I have figured that I could dump everything without grouping into a DataTable and go from there, but the code got ugly really quickly, and I haven't even tackled trying to group the result by userID.
Is there an easier way I can do this with SQL, or am I stuck with manipulating the DataTable?