jpa - JPQL Average Time Difference -
jpa - JPQL Average Time Difference -
i have order bills , receive bills. bill can have multiple bill items. 1 order bill item may have none or more receive bill items.
i want calculate lead time, average time difference between order , receipt in jpql (java persistance query language) query in days. utilize eclipselink 2.4 persistence provider.
this query attempted. there way can take average lead time using jpql ?
jpql = "select avg(b.createdat - rb.createdat) " + " billitem bi " + " bring together bi.bill b " + " joib bi.referancebillitem rbi " + " bring together rbi.bill rb " + " b.billtype in :bts " + " , rb.billtype in :rbts " + " , bi.item=:amp " + " , b.createdat between :fd , :td " + " ";
jpa jpql
Comments
Post a Comment