Type into Date

Hello Everyone,

I want to ask if how do I put yesterday’s date for example in the first 3 boxes and today’s date in the last 3 boxes.

image

Hi.

You can use .AddDays() next to a datetime value, such as Now or Today, to subtract a day. Then, you can use The TypeInto and the Month, day, year as separate values using Month(),Day(),Year(). Lastly, you can format the number with .ToString("00").

Also, these methods are just some vb, so it can be looked up online as well.

All in all, in your TypeInto activities you will have something like this:

TypeInto // Month(Now.AddDays(-1)).ToString("00")
TypeInto // Day(Now.AddDays(-1)).ToString("00")
TypeInto // Year(Now.AddDays(-1)).ToString("0000")
TypeInto // Month(Now).ToString("00")
TypeInto // Day(Now).ToString("00")
TypeInto // Year(Now).ToString("0000")

You might output each value beforehand so you understand the value you get when you execute each line of code.

Regards.

4 Likes
  • FromDay = Now.adddays(-1).tostring(“dd”)

  • FromMonth = Now.adddays(-1).tostring(“MM”)

  • FromYear = Now.adddays(-1).tostring(“yyyy”)

  • ToDay =Now.adddays(-1).tostring(“dd”)

  • ToMonth = Now.adddays(-1).tostring(“MM”)

  • ToYear = Now.adddays(-1).tostring(“yyyy”)

3 Likes

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.