Matthew R White Posted July 30, 2014 Posted July 30, 2014 I have a date field and I'm trying to sort/filter my records to only show records with dates of the current month (July) through the next 3 months (October) however id also like to show records from 2013 and 2012 of these months in particular. Example July 2014 ... ... ... 2013 ... ... ... 2012 ... ... ... Aug 2014 ... ... ... 2013 Not showing any records before July or After Month of October Please help, thanks
Lee Smith Posted July 30, 2014 Posted July 30, 2014 Why aren’t you creating a found set for the current period you want to see?
Matthew R White Posted July 30, 2014 Author Posted July 30, 2014 How do I do that? I currently have this calculation: Let ( d = Get ( CurrentDate ) ; Date ( Month ( d ) + 0 ; 1 ; Year ( d ) ) & "..." & Date ( Month ( d ) + 4 ; 0 ; Year ( d ))) However its only getting 2014's July - October
comment Posted July 30, 2014 Posted July 30, 2014 however id also like to show records from 2013 and 2012 of these months in particular. To find records in a range of months over a range of years, your request needs to look something like this (assuming m/d/y date format): {7..10}/*/{2012..2014} This should be relatively easy to calculate from the current date. Note, however, that during the period of September to December, you will need to calculate and submit two requests: one for the remainder of the year, and one for the extra month/s at the beginning of the year.
Matthew R White Posted July 30, 2014 Author Posted July 30, 2014 Ok so... I looked into the Constrain Found Set, which to use I would Show All Records then Constrain the Found Set to Month (Get (Current Date)) ... Month + 4, which should in theory constrain the Show All Records to those dates with the month digit of our current month plus 4, however Constrain found set only lets me put in a specific date, not a calculation. To find records in a range of months over a range of years, your request needs to look something like this (assuming m/d/y date format): {7..10}/*/{2012..2014} This should be relatively easy to calculate from the current date. Note, however, that during the period of September to December, you will need to calculate and submit two requests: one for the remainder of the year, and one for the extra month/s at the beginning of the year. Ok, I understand this calculation however how would I add Get Current Date - finding the current month + 4 so it would change every month as the month changes?
comment Posted July 30, 2014 Posted July 30, 2014 how would I add Get Current Date - finding the current month + 4 so it would change every month The same way you did before; use the current date to calculate the search string as text. For example: Let ( d = Get ( CurrentDate ) ; "{" & Month ( d ) & ".." & Month ( d ) + 3 & "}/*/" & "{" & Year ( d ) - 2 & ".." & Year ( d ) & "}" ) will return: {7..10}/*/{2012..2014} today (July 30, 2014) and: {8..11}/*/{2012..2014} a few days from now. But as I said earlier, it won't work if today is in October, November or December.
Recommended Posts
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