close ad
WARNING PC USERS: Do Not Install the DREAMWEAVER CC 2017 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Filter a recordSet by year using the date column

Thread began 1/20/2017 10:56 am by s.joiner74419001 | Last modified 1/23/2017 3:34 pm by Ray Borduin | 252 views | 3 replies |

s.joiner74419001

Filter a recordSet by year using the date column

I have a recordSet that selects two columns ( snippet , date [ yyyy-mm-dd ] ) from a NEWS database table. I am using the recordSet to create a list using a repeat region. I would like to be able to filter the list by year from a dropdown that sits above the list. I have been trying to use the 'DataAssist Search Behaviour' to achieve the task but can not work out how. I have managed to get a filter working but only as a comparison 'Less or equal to' that uses a parameter in a url. But I would need to filter between to dates to cover a year.

Any pointers please.

Ive attached page so you can see what I have tried so far.

thanks in advance

Attached Files
right-to-manage-news-t.php
Sign in to reply to this post

Ray BorduinWebAssist

There are probably a couple of ways you could do it, but one option would be to use something like:

php:
$WADbSearch1->addComparison("date","".isset($_GET['year']?"1/1/".$_GET['year']:"")  ."","AND",">=",2);

  $WADbSearch1->addComparison("date","".isset($_GET['year']?"12/31/".$_GET['year']:"")  ."","AND","<=",2);


and then just pass the ?year=2017 or whatever year in the url. You would want to also update the if statement of the filter to:

php:
if (isset($_GET['year'])) {
Sign in to reply to this post

s.joiner74419001

Thanks Ray.. this is just the job!!

I would also like to have another option to flip the list between oldest or latest by date.

I realise I can achieve this if i used a table with the 'sort behaviour'

But the list I'm filtering is in an 'unordered list'. So is there another way I can do this?

Thanks in advance.

Sign in to reply to this post

Ray BorduinWebAssist

It might be possible to find a jquery option to do the sort of the unordered list in javascript, but I've always done it with the recordset and sorting that way.

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...