I am using LLBLgen version 2.5
I am developing the application in Visual Studio 2005 and using sql server 2005.
I am using adapter template from llblgen and coding in C#
this is my sql script
SELECT SUM(transact.copies) as sumof copies
FROM Tranact
where code = 'FT'
and month = 2
and year = 2008
GROUP BY transact.batch
HAVING transact.batch = 200
this is what i had written as a function using llblgen
static public int BatchTotal(string pub,int period,int year,int batch)
{
DataAccessAdapter adapter = new DataAccessAdapter(dbConnectionString());
IPredicate filter = (TransactionsFields.Code == pub & TransactionsFields.Month == period & TransactionsFields.Year == year & TransactionsFields.BatchNo == batch);
int value = (int)adapter.GetScalar(TransactionsFields.Copies,null,AggregateFunction.Sum,filter);
adapter.Dispose();
return value;
}
I am bit confused about the having clause in my sql script.
I just want to know what i have done is right and another thing want to ask how about the HAVING clause in my sql script. How can i put it in my function using llblgen.
Please help me out.