close ad
Install the LAtest Updates to Work with CC 2017 and CC 2018
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Sort by Date not working

Thread began 4/21/2015 9:28 am by gstoyle396649 | Last modified 4/23/2015 2:33 pm by Ray Borduin | 779 views | 8 replies |

gstoyle396649

Sort by Date not working

I've set up sorting using table header links. These work fine for VARCHAR and INT columns but not for DATE.

DATE columns are formatted using the standard yyyy-mm-dd format. Sorting works fine in the actual database, but not on the web page.

Any help appreciated.

Sign in to reply to this post

Ray BorduinWebAssist

There is no reason why it would work any differently. I'd have to look at the code to see why it isn't working. Really date works exactly like an int as the database uses a timestamp as the date.

Sign in to reply to this post

gstoyle396649

That's what I figured but it doesn't seem to be working.

Which part of the code would you need to see?

Sign in to reply to this post

Ray BorduinWebAssist

If you attached the page that does the sorting and sent me a URL where I could view it, that might be enough.

Sign in to reply to this post

gstoyle396649

Thanks. I'll send you a PM.

Attached Files
list.php
Sign in to reply to this post

Ray BorduinWebAssist

It looks like it would work. I'd have to debug it directly through ftp. Is the column specified as a "Date" column in the database? Maybe it is the column type of the database causing issues.

Sign in to reply to this post

gstoyle396649

OK thanks - I've sent you a PM with login info.

Sign in to reply to this post

Ray BorduinWebAssist

The issue was that you already had an ORDER BY clause in your recordset SQL statement. The sort behavior was appending to that statement and not removing the sort you had there, so it was always sorting by name first... essentially negating any other sort since names are unique. The solution was to remove the ORDER BY statement from the recordset and add it as the default order by in the sort server behavior.

After making this change the page appears to work... it had nothing to do with data types or date fields.

Sign in to reply to this post

gstoyle396649

I thought it would probably be something simple - I didn't think to check that (obviously).

Many thanks for your help - it's much appreciated.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...