With SQLServer
fields.DefineField( OrderFieldIndex.OrderId, 0, "OrderID" );
fields.DefineField( OrderFieldIndex.OrderDate, 1, "Month" );
fields[1].ExpressionToApply = new DbFunctionCall( "MONTH", new object[] { OrderFields.OrderDate } );
This will create a query like
select orderID, MONTH(orderdate)
from xxxx
With Oracle the function to get the month is to_char(date, 'MM').
The select I want is
select orderID, to_char(orderdate, 'MM')
from xxxx
...
As I write my post, I answer my question.
Is this code is correct if I want to select month in Oracle ?
fields.DefineField( OrderFieldIndex.OrderId, 0, "OrderID" );
fields.DefineField( OrderFieldIndex.OrderDate, 1, "Month" );
fields[1].ExpressionToApply = new DbFunctionCall( "TO_CHAR", new object[] { OrderFields.OrderDate, "MM" } );
Thanks