Link to home
Start Free TrialLog in
Avatar of RWayneH
RWayneHFlag for United States of America

asked on

Set variable to Today + 180 days

How would I rewrite this so strDate results in Today + 180 days and in the formet yyyy-mm-dd  ?
strDate = Format(g_sDate, "yyyy-mm-dd")

Open in new window


not sure what the g_sDate is?  Please advise and thanks.
ASKER CERTIFIED SOLUTION
Avatar of Martin Liss
Martin Liss
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
strDate = Format(DateAdd("d", 180, g_sDate), "yyyy-mm-dd")
Avatar of RWayneH

ASKER

Ok.  I see it in a few places in the code.  My attempts at getting strDate defined to Today + 180.

strDate = Format(Date + 180, "yyyy-mm-dd")

Open in new window

 ??
Avatar of RWayneH

ASKER

It worked!!! I was totally guessing.
Avatar of RWayneH

ASKER

thanks for the help.
You’re welcome and I’m glad I was able to help.

If you expand the “Full Biography” section of my profile you’ll find links to some articles I’ve written that may interest you.

Marty - Microsoft MVP 2009 to 2017
              Experts Exchange Most Valuable Expert (MVE) 2015, 2017
              Experts Exchange Top Expert Visual Basic Classic 2012 to 2017