Jump to content
  • 0

How to set Date field automatically to default tomorrow's date?


ChrisGoode

Question

I have a table search that requires a date input, the field is dispatches_date.  I can get the field to auto populate with using [@cbTimestamp*] in the advanced section which gives me today's date.  My question is, is there a way to get Tomorrow's date to default in that field instead of today.  I have tried so many things, I think I am chasing my tail.

Any help is greatly appreciated.

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0
3 hours ago, Vitalikssssss said:

Hello ChrisGoode,

 

Have you tried to use Formula field with DataAdd() function?

You may find more in this following articles:

http://howto.caspio.com/tables-and-views/data-types/formula-fields/

http://howto.caspio.com/function-reference/

 

Hope this helps.

Thanks for the reply.  I don't think that will work.  I probably wasn't very clear in my original question.  I have a table report that I am doing some filtering on before the report comes up.  I want the date to be selectable but I am trying to get it to default to tomorrow as the majority of the time that is the date that will be used...I can get today to populate and be the default but having a hard time getting tomorrow.

Link to comment
Share on other sites

  • 0

Hi ChrisGoode,

 

I would suggest using Criteria to resolve your case.

Set the Comparison Type of the new criteria #1 to Today and criteria #2 to Next X days (specify the value 1). 

The field data type must be Date/Time.

You may find more in this article: http://howto.caspio.com/faq/reports-datapages/how-to-add-today-to-after-now-or-next-x-days-criteria/

Regards,

vitalikssssss

Link to comment
Share on other sites

  • 0

Hi! You may use the JS code below on your search elements and insert it on the Footer:

<script language="javascript">
/* Declaration and initialization */
Stamp = new Date();
var v_TimeStamp;
Month = (Stamp.getMonth() + 1);

if (Month < 10) {
Month = "0" + Month;
}

/* Construct the value of the v_TimeStamp variable in the format m/d/yyyy */
v_TimeStamp=( Month + "/" + (Stamp.getDate() + 1 ) + "/" +Stamp.getFullYear());

document.getElementById("Value1_1").value= v_TimeStamp;

</script>

Please change the 'Value1_1' if you are using other fields. You can also check this: 

 

-Potato

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