Iron Speed Technical Forums
Sign up Latest Topics
 
 
 


Reply
  Author   Comment  
ChrisSmith

Registered:
Posts: 44
Reply with quote  #1 
Hello Experts,
I have a show table page that is not sorting dates properly.  I verified that the ISD view for the ScanDate column has a 
Validation Type = Date
Display Format = 7/31/2012 (default)

On the page I have a Order value of
ORDER BY:         ScanDate DESC

When the show table is executed my first record is has a ScanDate value of  12/31/2011

The first value should be 1/31/2012

I verified that my MSSQL view is not sorting properly as well
My old view
SELECT     ScanDate, ResultIDFROM         A360.dbo.vResultsorder by    ScanDate desc

When executed my first record is has a ScanDate value of  12/31/2011
My new view
SELECT     ScanDate, ResultIDFROM         A360.dbo.vResultsorder by    order by cast([ScanDate] as Date) desc

When executed my first record is has a ScanDate value of  1/31/2012 which is correct.

I am hoping someone can tell me how to get my page to sort correctly in ISD

Regards,

Chris
akeshgupta

Avatar / Picture

Iron Speed MVP
Design, Develop & Deliver

Registered:
Posts: 1,095
Reply with quote  #2 

Chris:  If you don't sort the data in view but specify the sort order on the show table page, it should work.


__________________
Akesh Gupta
Light Speed Solutions, LLC.
If I rest, I will rust !   Let's share the knowledge !
ChrisSmith

Registered:
Posts: 44
Reply with quote  #3 
Akesh,
Sorry I wasn't too clear about that... 
I didn't sort the data in my original view... I only sorted the data as a troubleshooting measure to see if there was a sorting issue at the database level. 

Regards,

Chris
ChrisSmith

Registered:
Posts: 44
Reply with quote  #4 
Akesh,
Got it... I had to do my cast for the view's column and then it sorted perfectly.

SELECT     CAST(dbo.vResults.ScanDate AS Date) AS ScanDate, dbo.vResults.ResultID FROM   dbo.vResults

Thank-you!
Regards,

Chris
JimiJ

Avatar / Picture

MVP Developer
Registered:
Posts: 1,962
Reply with quote  #5 
Chris,

That's the right thing to do since columns often lose their data types through the usual view scripting, most particularly when the null value is allowed.

Cheers,
Jimi J 

__________________

  Jaime Jegonia
[jts_logo]

Iron Speed MVP Developer
 

". . . and whoever sows generously will also reap generously" 2 Cor 9:6

Previous Topic | Next Topic
Print
Reply

Quick Navigation:

Easily create a Forum Website with Website Toolbox.

Download Iron Speed Designer

Terms of Service Privacy Statement