Avatar of Srinivas_Vengala
Srinivas_Vengala
Flag for India asked on

Sorting on TimeStamp Column in Grid View

Hi,

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

Avatar of undefined
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
William Peck
ASKER CERTIFIED SOLUTION
Srinivas_Vengala

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
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.
ask a question