I have a dynamic SOQL query where in I am using order by clause.I want to sort it by product Style
SOQL
soql =
'select id, name,Warehouse__c,Product_Reference__r.gii__ProductStyle__r.name,
Product_Inventory__c , Product_Reference__c,Product_Inventory__r.gii__Product__r.name,
Product_Inventory__r.gii__Product__r.gii__ProductStyle__r.name,Product_Reference__r.gii__ProductCode__c,
Sales_Year__c,(select id,name,Quantity__c,Month__c from Forecast_Details__R)'+
' from forecast__c where Sales_Year__c =' + '\''+selectSalesYear.id +'\''+ 'and Warehouse__c =\'' + selectedWarehouse.id + '\' ' +
filterQueryPart +
' Order By Product_Reference__r.gii__ProductStyle__r.name NULLS Last,
Product_Inventory__r.gii__Product__r.name NULLS Last limit ' + PageSize + ' offset ' + PageNumber*PageSize;
If i am using NULLS First, its working like a charm. But in Nulls Last, it is not working, all the Product style which are null are coming first.
Can someone help me with the error??
Thanks
Samir