Help! I just can't find it in the documentation
I've found this:
where some function mappings are described - but I can't figure out how to use them.
Consider this simple query
var customerProducts = new EntityCollection<CustomerproductEntity>();
using (var adapter = new DataAccessAdapter())
var qf = new QueryFactory();
var q = qf.Customerproduct
.Where(CustomerproductFields.CustomerId == 5);
JOIN products ON customerproducts.productid = products.id
WHERE CustomerId = 5
What I would like is to add some date-filtering like this:
AND MONTH(customerproduct.nextinvoicingdate) = ?month
AND YEAR(customerproduct.nextinvoicingdate) = ?year
but - I am unable to guess how to use the Year() and Month() functions in the .Where(...) clause of my QuerySpec - and I can't find it There are GreaterThan(...) , Between(...) like this
- but I want to compare the specific year part of the datetime in NextInvoicingDate.
Also, I would like to add
AND ((d.date_of_discontinuation IS NULL) OR (d.date_of_discontinuation >= DATE_ADD(customerproduct.nextinvoicingdate, INTERVAL customerproduct.invoiceInterval MONTH)))
which would be something like appending
.Where(CustomerproductFields.NextInvoicingDate."GetValue().Add(something, something)" > something else)
- but probably isnt...
Could someone please provide a simple example for how to actually use the YEAR() and DATE_ADD() functions?
Thanks in advance!
LLBLGen 5.6.1, MySQL