Alternatively – accomplishes the same thing.
SET VAR vdate DATE =(.#DATE) SET VAR vprevious_date date= (ADDMON (RDATE(IMON(.vdate),1,IYR4(.vdate)),-2)) Regards, Ken From: [email protected] [mailto:[email protected]] On Behalf Of Doug Hamilton Sent: Thursday, January 12, 2023 2:12 PM To: [email protected] Subject: Re: [RBASE-L] - Date Jan, try this: --vDate is a test date, try different values; change to .#Date in the expression after testing SET VAR vdate DATE = '2/28/2023' SET VAR vStartDate DATE = + (RDATE( (IMON( ADDMON(.vdate,-2))),1,(IYR(ADDMON(.vdate,-2))) )) SHOW VAR vstartdate RETURN Doug On 1/12/2023 12:27 PM, jan johansen wrote: All, I'm having a brain cramp. My code doesn't handle crossing years apparently. I need to set a start date that is the first of the 2 months ago based on today i.e. 11/1/2022 Thanks Jan -- For group guidelines, visit http://www.rbase.com/support/usersgroup_guidelines.php --- You received this message because you are subscribed to the Google Groups "RBASE-L" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected] <mailto:[email protected]> . To view this discussion on the web visit https://groups.google.com/d/msgid/rbase-l/WC20230112182746.3000D7%40jjcalibrations.com <https://groups.google.com/d/msgid/rbase-l/WC20230112182746.3000D7%40jjcalibrations.com?utm_medium=email&utm_source=footer> . _____ <https://www.avast.com/antivirus> This email has been checked for viruses by Avast antivirus software. www.avast.com <https://www.avast.com/antivirus> -- For group guidelines, visit http://www.rbase.com/support/usersgroup_guidelines.php --- You received this message because you are subscribed to the Google Groups "RBASE-L" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected] <mailto:[email protected]> . To view this discussion on the web visit https://groups.google.com/d/msgid/rbase-l/5967bf96-15ae-6114-3a01-83e4aa986d07%40wi.rr.com <https://groups.google.com/d/msgid/rbase-l/5967bf96-15ae-6114-3a01-83e4aa986d07%40wi.rr.com?utm_medium=email&utm_source=footer> . -- For group guidelines, visit http://www.rbase.com/support/usersgroup_guidelines.php --- You received this message because you are subscribed to the Google Groups "RBASE-L" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/rbase-l/000501d926ed%24f845f820%24e8d1e860%24%40optonline.net.

