Jump to content
  • 0

Filter Results



Need help... I am trying to show all results from a search which are 3 days old. Those which are less than 3 days old will be filtered out. How can i achieve that using caspio? Eg. I have a field named startdate which is of date type. Assuming today is 29/3, my app will return only data up till 26/3. Those new records with startdate from 27/3 to 29/3 will be filtered out. Thanks :)

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

Hi maymusic, u got me wrong

I need d app to display results less the recent 3 days, n not d other way round eg






I need d app to display results for 25/6 & 26/6. I dont want results for 27/6, 28/6 & 29/6 to be shown to d user

The previous (3) days will show me results for 29/6, 28/6 & 27/6



Link to comment
Share on other sites

  • 0

Oh I see what you are looking for now... unfortunately we cannot add javascript to a filtering page to make this happen but if you have a search page to search for data, you can calculated 3 days ago and then receive the value in date field and select less than or equal as comparison type. If you have a search page, give me the link to it I can then guide you how to calculated 3 days before now it should be like:

function f_date(){

var today= new Date();

var threedaysago = (today.getMonth() + 1) + "/" + (today.getDate() - 3) + "/" + today.getFullYear();

document.getElementById('Value1_1').value =threedaysago;

document.getElementById('searchID').onmouseover = f_date;

Value1_1 is the ID of the date field.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...