[Vtigercrm-developers] Order by Number

Richard Hills - Technologywise richard at tw.co.nz
Sun Nov 30 23:20:58 GMT 2014


I may be over simplifying this, but should we not be able to adjust the 
sorting for this column to just sort by the id rather than the entity 
number and end up with the same result?

In 5.4 we noticed this issue and decided to force all of our numbering 
to start from 100,000 which is a much uglier solution I must admit, but 
also solved the issue for us.

On 29/11/14 09:27, VTE wrote:
> Play around with this query, you will need to run multiple queries based on
> the Ticket number length. It will add 0's to the number and the sorting will
> work
>
> ### Select - Testing
> SELECT
>    ticketid,
>    ticket_no,
>    LEFT(ticket_no, 2) AS TT,
>    RIGHT(ticket_no, 3) AS num,
>    CONCAT(LEFT(ticket_no, 2), '0', RIGHT(ticket_no, 3))
> FROM
>    `vtiger_troubletickets`
> WHERE LENGTH(ticket_no) < 6  AND LENGTH(ticket_no) >= 5
>
> ### Update
>
> UPDATE
>    `vtiger_troubletickets`
>    SET ticket_no=CONCAT(LEFT(ticket_no, 2), '0', RIGHT(ticket_no, 3))
> WHERE LENGTH(ticket_no) < 6  AND LENGTH(ticket_no) >= 5
>
>
>
>
> -----
> VT Experts
> Email: Support at VTExperts.com
> Web:  http://www.VTExperts.com
> Skype: VTExperts
> Phone: +1 (818) 495-5557
>
>
>
> --
> View this message in context: http://vtiger-crm.2324883.n4.nabble.com/Vtigercrm-developers-Order-by-Number-tp14609p14612.html
> Sent from the vtigercrm-developers mailing list archive at Nabble.com.
> _______________________________________________
> http://www.vtiger.com/

-- 
Richard Hills
TechnologyWise Ltd, Tauranga, NZ
richard at tw.co.nz
www.technologywise.co.nz
ph: +64 (0)7 571 1060
fax: +64 (0)7 571 1061



More information about the vtigercrm-developers mailing list