After asking so many questions, i finally succeeded in tweaking out a query that is correct.
it is as follows;
Select Customer, Count, Credit, Debit, Balance, Date from
Select Customer_ID as Customer, (count(Credit) + count(Debit)) as Count, sum(Credit) as Credit, sum(Debit) as Debit
from ThriftsTrans Where Transaction_Date Between'15/Dec/2013'And'18/Dec/2013'GroupBy Customer_ID
) as a leftjoin (
Select Customer_ID as Cust, Account_Balance as Balance,
Transaction_Date as Date From ThriftsTrans Where Transaction_Date In
(Select Max(Transaction_Date) From ThriftsTrans Where Transaction_Date
) as b on a.Customer = b.Cust
I have to write a query where there will be multiple filters selected by user. These filters will be selected randomly in any combination
(for example filters like: Co.name, deptId, Startdate, endDate, employee name, Assignment, Shifts, class)
Can anyone tell me how to write such type of query?
As there cn be n numbers of permutation & combination of all filters.