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

Trying to show promised deliveries for prior 3 months 1

Status
Not open for further replies.

BradCustom

IS-IT--Management
Oct 5, 2007
296
0
0
US
I'm using Crystal Reports 2011 with an SQL database.
I'm having a tough time trying to show the prior 3 months promised deliveries when the current month is January. The reason is because the promised dates are in the prior year (Oct, Nov and Dec). The report has 12 subreports, 1 for each month so it's really only the Oct, Nov and December subreports that are effected. The main report really doesn't have anything on it except all of the Sales Order deliveries for all time. Which I use only as a place holder. The 12 subreports are in the Main Report footer and based on the current month the prior 3 months subreports are visable. The issue I'm having is getting the Oct, Nov and Dec subreports to select the prior years data when the current month is either Jan, Feb or Mar. I've tried a few record selection formulas but not getting the correct month's promised dates.

Any help would be greatly appreciated!!
 
Use the dateadd function—it will automatically adjust for the year.

-LB
 
LB,
I used your formula from a different thread and it seems to work fine for what I am trying to accomplish. Below is the formula.

{SO_Detail.Promised_Date} in DateAdd("m",-3,currentdate-day(currentdate)+1) to dateadd("m",-3,currentdate-day(currentdate)+31)

Thanks for your help.
Brad
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top