11 Replies Latest reply: Aug 24, 2011 4:07 AM by Anne Duffy RSS

    Sort List boxes

      Hi Guys

       

      I have a list box with dates on it, there are dates in the past present and future, I wish to default the first displayed date as Today -5,

       

      Can this be done ?

       

      Thanks,


      A

        • Sort List boxes

          hi,

           

          Right click on list box and so to sort tab select expression and type

           

          if(date(listboxname)=date(today()-5), listboxname)

           

          Sumit

            • Sort List boxes

              Hi Sumit

               

              I can not get it to work,

               

              The List Box is based on a Cyclic Group called Date Group , I have changed it to Date field and tried

               

              if(date(Date)=date(today()-5), Date)

               

              But I am afraid this does not work either , perhaps you could help

               

              Thanks

              A

               

                • Sort List boxes
                  Erich Shiino

                  Hi,

                  Try this:

                  if ( num([Date Group]) = num(today())-5,[Date Group])

                  Hope this helps,

                   

                  Erich

                    • Sort List boxes

                      Hi Erich,

                       

                      I was away for awhile, the above is very helpful, but that just brings the date 5 days ago to the top of the list box, at the moment it looks like this

                       

                      DATE GROUP

                      1/03/11

                      2/03/11

                      3/03/11 etc etc etc

                      20/08/11

                      21/08/11

                       

                      I wish for the last 5 days to be top of the list box, so today is the 23/08/11 so,

                       

                      DATE GROUP

                      18/08/11

                      19/08/11

                      20/08/11

                      21/08/11

                      22/08/11

                      1/03/11

                      2/03/11 Etc etc

                       

                      Is this possible ?

                       

                      Thanks

                      A

                        • Sort List boxes
                          Kaushik Solanki

                          Hi,

                           

                              Try this in sort tab.

                           

                              Check Expression and type

                             

                              if ( num([Date Group]) = num(today())-5,1,2)

                           

                              Uncheck every other sort options.

                           

                          Regards,

                          Kaushik Solanki

                            • Sort List boxes

                              Hi Kaushik,

                               

                              This is giving me - the date 5 days ago plus the date 4 days ago, see below

                               

                              DATE GROUP

                              18/08/11

                              19/08/11

                              1/03/11

                              2/03/11 Etc etc

                               

                              I have tried to amend yourexpression to if ( num([Date Group]) = num(today())-5,1,2,3,4,5) to get all 5 dates but it is not working , can you help, perhaps I am doing some

                                • Sort List boxes
                                  Erich Shiino

                                  Hi,

                                  Try this then:

                                  if ( num([Date Group]) <= num(today())-5, num ( [Date Group]),num ( [Date Group])*1000 )

                                  The if condition will just create weights to the two sets of dates

                                  Hope this helps,

                                   

                                  Erich

                                  • Sort List boxes
                                    Kaushik Solanki

                                    Hi,

                                     

                                        Try this.

                                     

                                        if ( num([Date Group]) = num(today())-5,1,

                                        if ( num([Date Group]) = num(today())-4,2,

                                        if ( num([Date Group]) = num(today())-3,3,

                                        if ( num([Date Group]) = num(today())-2,4,

                                        if ( num([Date Group]) = num(today())-1,5)))))

                                     

                                    Regards,

                                    Kaushik Solanki

                                      • Sort List boxes

                                        Im really sorry guys this just does not seem to work, for Erich solution there is no change to the order 9 I have put in sort tab, ticked expression and pasted in)

                                         

                                        For Kaushik, I cant quite figure out what I am getting , the following is the result,

                                         

                                        Date.bmp

                                         

                                        The 7/03/11 is the First calander date !! i would have liked it to be

                                         

                                        Date

                                        17/08/11

                                        18/8/11

                                        19/8/11

                                        22/8/11

                                        23/8/11

                                        7/03/11

                                        8/3/11

                                        etc etc

                                         

                                        Thanks guys