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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Formula to report cetain dates 1

Status
Not open for further replies.

leedy33

Technical User
Jun 15, 2005
51
US
I'm using crystal 8.5 and in my report i'm trying to set up a monthly report that shows how many groups we have done year to date, last 30 days and 14 days. Within those three date ranges, i want to list which ones were early and which were late. The problem that im having is i dont know how to set up a formula so that only the reports that are shown are in one of those 3 ranges. I can get true/false read outs but that is it. I cant use the selection expert because i need to be able to put the reports in each range into another formula so that i can look off of them to find which ones were late and early. I hope some one understands what im trying to say, if need help clarifying just let me know. Any help of any kind would be much appreciated. Thanks
 
Create a formula field, to be used for grouping
Code:
if {yourdate} >= currentdate-14 then "1) Last 14 days"
else
if {yourdate} >= currentdate-30 then "2) Last 30 days"
else "3) Year To Date"

The prefix ensures you get the order you want, regardless of what you call the group.

Use report selection {yourdate} >= currentdate-365 to eliminate records that you don't need for your report.



[yinyang] Madawc Williams (East Anglia, UK) [yinyang]
 
Hey thanks alot, so if i want to only have records from 2005 then to eliminate records i dont want do i use report selection and put: (mydate)= year(2005)
 
So in using this formula field do I make a group with "yourDate" and how do i use this formula so that i can then replug it in and get the reports that were early for each of the 3 date ranges. I'm a little confused on that part.
 
{yourdate} stands for the actual name of the data on your database. You should be able to paste it in from the formula editor.

Once you have the formula, you should see it as an 'available field' when you create a group.

[yinyang] Madawc Williams (East Anglia, UK) [yinyang]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top