Richard_N Posted June 12, 2008 Posted June 12, 2008 My brain is foggy today and am reaching out for help. How do I calculate the date (dd/mm/yy) for the first day of the month previous to the current date? Examples: Current Date = 6/12/08 Result 5/1/08 Current Date = 1/20/08 Result 12/1/07 I will be writing a script to find all the records in my database for the previous month. I have found custom functions for calculating the last day of the previous month but am stumbling on the best way for getting the first day of the last month. Thanks to all who reply Rich :)
comment Posted June 12, 2008 Posted June 12, 2008 Date ( Month ( Get (CurrentDate) ) - 1 ; 1 ; Year ( Get (CurrentDate) ) )
LaRetta Posted June 12, 2008 Posted June 12, 2008 I have found custom functions for calculating the last day of the previous month Custom function is not required for this either. Date ( Month ( Get ( CurrentDate ) ) ; 0 ; Year ( Get ( CurrentDate ) ) ) or even ... Get ( CurrentDate ) - Day (Get ( CurrentDate ) )
Recommended Posts
This topic is 6068 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now