You need to sign in to do that
Don't have an account?
viv1
Sorting according to date and name !
i want to sort values to popolate in piclist in soql..
sort is done using date(date time ) and then name(string)
i have written a query but its not working
===> order by CreatedDate,company__c
Can you post th whole code so that we can help.
SELECT Company__c, ContactID__c, CreatedDate,name FROM Payee__c order by CreatedDate,company__c
What is not working for you,I tried the below query and it is working for me :-
SELECT CreatedDate,name FROM Account order by CreatedDate,name
created date is in date time format...
i want to sort data as...first it should be sorted through date... n then fields having same date...should be sorted through name !!
but in date time field...it is considering 2 fields having similar date but diffrent time....difrent fields...
CreatedDate would not work here,create a formula field where you will convert DateTime field into
Date field(Conert CreatedDate value in Date using that field) and then use that in your query.