Sort By DateDiff?

Posts   
 
    
Posts: 112
Joined: 09-Aug-2004
# Posted on: 31-May-2005 14:31:40   

I've searched but I haven't come up with much. I am thinking this isn't possible just yet but I will ask anyway.

 SELECT * FROM Table Order By DateDiff(n, Date, Minutes) 

Is this possible to do yet?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 31-May-2005 14:45:28   

No that's currently not possible. You can work around it by adding a computed column to the table, which you use to sort on

Frans Bouma | Lead developer LLBLGen Pro
Posts: 112
Joined: 09-Aug-2004
# Posted on: 31-May-2005 16:22:41   

Are you referring to the DataTable object or the Collection Object? If you are referring to the Collection Object can you supply me with a sample?

Thank you.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 31-May-2005 16:59:33   

lethologica wrote:

Are you referring to the DataTable object or the Collection Object? If you are referring to the Collection Object can you supply me with a sample?

Thank you.

No, to the database table. The field in the database table then has to have a formula defined which is equal to the expression you specified. (Or 'computed_column_expression' as it is called in BOL).

Frans Bouma | Lead developer LLBLGen Pro