QUERY: ------ select tel.expenseSheet.documentNo as documentNo, tel.expenseSheet.id as expenseSheetId, tel.description as description, case when tel.expenseDate is not null then tel.expenseDate else tel.expenseSheet.reportDate end as expenseDate, tel.product.id as productId, tel.product.name as productName, tel.quantity as quantity, tel.uOM.name as uomName, p.id as projectId, p.name as projectName, tel.expenseSheet.processed as processed from TimeAndExpenseSheetLine as tel LEFT JOIN tel.project as p, ADUser as u where tel.timeSheet = 'Y' and tel.client.id=:client and tel.expenseSheet.businessPartner=u.businessPartner and u.id=:user order by tel.expenseSheet.reportDate, tel.expenseSheet.documentNo ------------------------------------------------ ------------------------------------------------ ERROR AT OPENBRAVO.LOG: ----------------------- 7ef0fb8d 4487905 [http-8080-8] ERROR org.hibernate.hql.PARSER - line 1:32: unexpected token: select 7ef0fb8d 4487991 [http-8080-8] ERROR org.openbravo.service.datasource.DataSourceServlet - unexpected token: select near line 1, column 32 [select count(*), sum(quantity) select tel.expenseSheet.documentNo as documentNo, tel.expenseSheet.id as expenseSheetId, tel.description as description, case when tel.expenseDate is not null then tel.expenseDate else tel.expenseSheet.reportDate end as expenseDate, tel.product.id as productId, tel.product.name as productName, tel.quantity as quantity, tel.uOM.name as uomName, p.id as projectId, p.name as projectName, tel.expenseSheet.processed as processed from TimeAndExpenseSheetLine as tel LEFT JOIN tel.project as p, ADUser as u where tel.timeSheet = 'Y' and tel.client.id=:client and tel.expenseSheet.businessPartner=u.businessPartner and u.id=:user]