Jump to content
  • 0

Search for Week end criteria


Mirko

Question

Hello,  I would like to put a checkbox  that once clicked make a search in table and show only the Week end results. Would you please make same example how to achive it? 

I ve a DataPages > Reports > Tabular - Table already includes a data field. 

thanks and regards!

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 1

Hi @Mirko! Maybe you can try this idea:

- create a checkbox that will indicate if a record has a date during a weekend or not

- create a trigger or task that will mark this checkbox accordingly:

image.png.8fbf96dee4bb67ae38f969418468e66f.png

 

This setup just updates the inserted record's checkbox field to TRUE if the date field value is on a weekend. 1 is sunday 2 is saturday.

After that, you can just include the checkbox on your search fields so your users can choose if they want to see weekend dates or not.

 

You can use either a trigger or a task based on your needs. As you know, triggers run on insert, update, and delete. So, if you plan on adding more records to your table, this is ideal. However, if you won't be adding more record, you can use a task to update the record's checkbox value at once.

 

I hope this helps!

Link to comment
Share on other sites

  • 0
1 hour ago, ParkLoey said:

Thanks ParkLoey for you support... unfortunately I m working with a Free license version where either Trigger and Task are grayed.  I really appreciate your answer if you know another way please share more insight.

Kind regards!

 

Hi @Mirko! Maybe you can try this idea:

- create a checkbox that will indicate if a record has a date during a weekend or not

- create a trigger or task that will mark this checkbox accordingly:

image.png.8fbf96dee4bb67ae38f969418468e66f.png

 

This setup just updates the inserted record's checkbox field to TRUE if the date field value is on a weekend. 1 is sunday 2 is saturday.

After that, you can just include the checkbox on your search fields so your users can choose if they want to see weekend dates or not.

 

You can use either a trigger or a task based on your needs. As you know, triggers run on insert, update, and delete. So, if you plan on adding more records to your table, this is ideal. However, if you won't be adding more record, you can use a task to update the record's checkbox value at once.

 

I hope this helps!

 

Link to comment
Share on other sites

  • 0

Hi @Mirko! hmmmm in that case, you can try including the calculation to identify if the date being entered in the submission form is a weekend date or not. Here's what you need to do:

1. create a checkbox field on your table which will indicate if the record has a weekend date or not

2. on your submission form where you submit records to the table, include the checkbox field

3. make the checkbox field's form element to calculated value and use this formula:

CASE 
WHEN DatePart(dw, [@field:DateField]) = 1 OR  DatePart(dw, [@field:DateField]) = 7
THEN CAST(1 as bit)
ELSE CAST(0 as bit)
END

4. if you do not want to show the result of the calculation on your submission form, you can just hide it by going to advanced then check "hide field"

image.png.e69c7fce94ebf7387d0412557beb893a.png

 

NOTES:

- this will only work if you add records to your table using a submission form. Otherwise, you need to manually indicate if it is a weekend or not through the table directly.

- you cannot use the formula in a formula field in a table as stated in Caspio's Function Reference article

 

I hope this one works for you  ≧◠‿◠≦✌

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.

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

Loading...
×
×
  • Create New...