Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

trying to make a dange range for every 6 or 12 months 1

Status
Not open for further replies.

valgore

Technical User
Nov 12, 2008
180
US
Hi, im writing a report and i want the report to only show date range for every 6 months or month or 12 months. can anyone help me?

thanks
JB
 
Are you saying you want to create groups based on six-month intervals? If so, create a formula to use for your groupfield:

select month({table.date})
case 1 to 6 : "January to June"
case 7 to 12 : "July to December"

-LB

 
wow i feel like such an idiot lol. it is so simple. thank you SO much.

JB
 
hmm. i tried this out, and it's not what i want. i want to be able to sort from todays date. so like 6 months from todays date or 12 months from todays date. also im coming across a problem when its january and i want to go 6 months back. it gives me a negative month number.

JB
 
Please explain in more depth what you are trying to do. What do you mean by sorting from today's date? Are you always trying to capture data from previous time periods? Do you want to see 6-month intervals for a period of several previous years? Or are you saying you want to be ablt to select the specific interval (6, 9, 12-month, etc.)?

-LB
 
ok. so this is the report.
we have client names, and when the last time they came in to the office. i want to be able to sort the report so that i can see all the clients that came in between todays date (whichever that date is) and 6 months ago from todays date. or i want to sort between todays date and 12 months ago. but the problem i am having is that say its january 21st. i want to be able to see all the clients that came in 6 months ago from January. how do i make the formula go back a year?

i hope that makes sense.

JB
 
Your use of "sort" is confusing. If you mean you want to select data for the last six or 12 months, then set up a number parameter {?MonthsAgo} and use it in your selection formula like this:

{table.date} in dateadd("m",-{?MonthsAgo},currentdate) to currentdate

-LB
 
ok sorry. lets see if this makes sense. you right. i did word it wrong. i want to be able to select a parameter that says every 6 months or 12 months from current date

JB
 
your right. i want to make a parameter for every 6 or 12 months from current date

JB
 
So you should be all set after my last post, right?

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top