1
0
-1

Hai all, 

I have one variable name which is Date and my datatype VARCHAR. So my question is how can i do the query to sorting the date variable in descending order. Cause i have done the query part and the result still not in proper way. cause the query only compare the 2 no. in front 

This is sample my data and sorting result


                  

 

    CommentAdd your comment...

    1 answer

    1.  
      1
      0
      -1

       

      select *,
      ROW_NUMBER() OVER (ORDER BY tenantID) AS No,
      Convert(INT,SUBSTRING(dueDate, 1, 2))AS Days,
      Convert(INT,SUBSTRING(dueDate,4,2)) AS Months,
      Convert(INT,SUBSTRING(dueDate, 7,9))AS Years
      from app_fd_finalReportTenant
      where statusPlace <> 'Vacant'
      and statusPlace <> 'Expired'
      order by Months,Years,Days ASC

       

      I get an answer in query part. but when i paste the query in Joget it say cannot retrieve column. Can help me? 

        CommentAdd your comment...