Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 3229

Re: How to get start date of the last month and end date of the last month

$
0
0

Please try as follow,

 

Date   ldt_in_date

Long   ll_y , ll_m

// Input date.. I use Today() as input date..
ldt_in_date = Today()

ll_y  = Year (ldt_in_date)
ll_m  = Month(ldt_in_date)

IF ll_m = 1 THEN
ll_m = 12
ll_y --
ELSE
ll_m --
END IF

MessageBox( "Last Month Start date" , String( Date(ll_y, ll_m, 1) ) )
MessageBox("Last Month End date" , String( RelativeDate(Date(Year(ldt_in_date), Month(ldt_in_date), 1), -1)))

 

Regards,

Jahir


Viewing all articles
Browse latest Browse all 3229

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>