Order resultset of query by a custom built column [ using dateadd ]

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • samvb
    New Member
    • Oct 2006
    • 228

    Order resultset of query by a custom built column [ using dateadd ]

    Hi,

    I have this query:

    Code:
    SELECT finishtime, bonas, dateadd('s',bonas,finishtime) AS fmore
    FROM scores;
    It works great but I need to order the result by fmore. It generates errors. Is there anywork around that?

    finishtime holds time and differs while bonas is seconds.
  • liimra
    New Member
    • Aug 2010
    • 119

    #2
    Solution/

    This should work

    Code:
    SELECT finishtime, bonas, DateAdd('s',[bonas],[finishtime]) AS fmore
    FROM score
    ORDER BY DateAdd('s',[bonas],[finishtime]);
    Regards,
    Ali

    Comment

    • samvb
      New Member
      • Oct 2006
      • 228

      #3
      thank you!

      thank you!

      u saved my day!

      Comment

      • liimra
        New Member
        • Aug 2010
        • 119

        #4
        //

        Glad it worked for you. Would you kindly mark this post as answered
        so it becomes more helpful for others.

        Regards,
        Ali

        Comment

        Working...