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

Popular posts from this blog

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -