cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
bullet117
Regular Visitor

Set Variables to current year and Month

In my App OnStart if have:

Set(varYear, 2020); Set(varMonth, 7)

and all works fine,

 

when I set it to:

Set(varYear, Year(Now()); Set(varMonth, Month(Now())

it doesn't work any ideas on how to get this to work, any help would be greatly appreciated...thanks 

1 ACCEPTED SOLUTION

Accepted Solutions

The screenshot make it clear.

Set(varYear, Year(Now()));

 Set(varMonths, Month(Now()))

 

There should be another ) for each Set

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

 

View solution in original post

6 REPLIES 6
eka24
Super User
Super User

Your formula seems ok. Did you have same variable names. Did you get error.

Set(varYearr, Year(Now()); Set(varMonths, Month(Now())

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Yes, I have the right variable names, no errors, nothing shows up in my text box, just the - (hyphen) for the following formula:

varMonth & " - " & varYear

 

The only thing I see is a little red squiggle on the end of the OnStrart formula:

Set(varYear, Year(Now()); Set(varMonths, Month(Now())..

 

Please show a screenshot. Also when you hover the cursor on the red Dot what is the message?

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Here is the OnStart command

Screen Shot 2020-07-31 at 12.52.45 PM.png

I get nothing on the hover over the Red squiggle.

The screenshot make it clear.

Set(varYear, Year(Now()));

 Set(varMonths, Month(Now()))

 

There should be another ) for each Set

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

 

View solution in original post

Thank you eka24 that did the trick, sometimes I can't see the forest through the trees....

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (2,433)