2
I am trying to apply a between with two fields of a part of my form, are dates and vehicle ids, I do not have much knowledge of how it models this by HQL in nhibernate with c#, I wonder how it would be to apply this in hql.
Usually my queries using HQL are like this:
public IList<Abastecimento> ConsultaData(DateTime DtAbastecido)
{
string hql = "SELECT a FROM Abastecimento a";
IQuery query = session.CreateQuery(hql);
return query.List<Abastecimento>();
}
Using query like this I later use in controller I apply as follows:
var Rota = ckm.ConsultaProduto(viewModel.NumCarroId);
I wanted to know how to put a between bringing dates, an example would be to bring me a record from 01/11/2017 until 01/12/2017, wanted to know how would be the query HQL applying the between with two textbox I will use in the form.
what is the name of the Date column?
– Leandro Angelo
recommend reading https://docs.jboss.org/hibernate/orm/3.5/reference/en/html/queryhql.html
– Leandro Angelo
@Leandroangelo The column name is Dtabastecido
– Guilherme Padovam