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 rbase-l+unsubscr...@googlegroups.com. 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>.


--
This email has been checked for viruses by Avast antivirus software.
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 rbase-l+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rbase-l/5967bf96-15ae-6114-3a01-83e4aa986d07%40wi.rr.com.

Reply via email to