I am trying to apply sorting on timestamp column in a grid view. In the DB it is of type timestamp but in the datatable and the wsdl which am using for the grid view population the column is of type string .
How can I apply sorting on that columns without disturbing the declaration. I cannot change to type datetime since it has its string references in many other places .
Can anyone pls let me know .
Thanks.
.NET Programming
Last Comment
Srinivas_Vengala
8/22/2022 - Mon
ashraf882
Try like this-
SELECT * FROM Table
ORDER BY CAST(Column AS DATE)
Srinivas_Vengala
ASKER
I am not querying the database. I am populating the grid using a wsdl info.. In the proxy class also the type of timestamp column is of string .
Srinivas_Vengala
ASKER
I ran into problems when sorting with dates and it was sorting the columns as a string.
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
SELECT * FROM Table
ORDER BY CAST(Column AS DATE)