CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Report Sorting

  1. #1
    Join Date
    Jan 2010
    Posts
    1

    Question Report Sorting

    Hi,

    Can someone please help me, this is very urgent.
    I need to create a report that has a formula field in combining a quote number and a quote line but now if i put a sort in it sorts the quote number correctly but not the lines. for e.g if it has more than 10 lines it sorts it as follow
    quote1 - 1
    quote1 - 10
    quote1 - 2
    quote1 - 3
    and so forth...

    what i gathered is that i need to somehow sort 2 characters and not one

    please assistQuestion

    thanx alotSmile

  2. #2
    Join Date
    Jul 2005
    Posts
    1,083

    Re: Report Sorting

    There are several ways to solve your problem... here are an easy one...
    Modify your formula, instead of just concatenating the fields... add one zero or two or three
    according with the maximun number of quotelines that you are going to manage
    (I'm considering that both fields are string type and you could have quoteline from 1 to 100)

    [Code]
    If Length({Table.quoteline})=1 then {Table1.quotenumber} + "00" + {Table1.quoteline} else
    If Length({Table.quoteline})=2 then {Table1.quotenumber} + "0" + {Table1.quoteline} else
    {Table1.quotenumber} + {Table1.quoteline}
    {/Code}
    Last edited by jggtz; January 18th, 2010 at 10:06 AM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured