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

12 Months Back and 3 Months Forward

Status
Not open for further replies.

strom99

MIS
Nov 28, 2000
126
US
I have a graph that is showing the past 12 months of shipments using the following

CDate(DateAdd ('M',-12,CurrentDate ))

Now I need to be able to see the next 3 months for future demand. How would I accomplish this? Using CR8.5.

Thanks
 
DateAdd ('M',3,CurrentDate)

You do not need the Cdate() function in either formula. Software Support for Macola, Crystal Reports and Goldmine
dgilsdorf@mchsi.com
 
Anyone no a way this could work in a CrossTab, thanks!
 
To answer the original question, you could add three months to the current date like this:

CDate(DateAdd ('M',-12,DateAdd('M',3,CurrentDate)))
Howard Hammerman,
Editor and Publisher of Database Reporting Made Easy newsletter
howard@hammerman.com
800-783-2269
 
I need to pull the last full 12 months of data. I have a field, RCV_DATE. I need all data where RCV_DATE is any date within the last 12 full months.
I'm lost. There's LastFullMonth, and LastFullWeek, but nothing for year. Linda
 
Dear Herrld,

Try this in the Select Expert:

{YourTable.RCV_Date} in
dateadd('m',-12,Date(Year(CurrentDate),Month(CurrentDate),1)) to
dateadd('d',-1,Date(Year(CurrentDate),Month(CurrentDate),1))

If you need more assistance, just ask.
ro
Rosemary Lieberman
rosemary@microflo.com, Microflo provides expert consulting on MagicTSD and Crystal Reports.
 
Ro...
Thank you for saving me SO much time. It works great, except for one weird thing. When I run it today (11/18), it returns data up to and including 10/30. I know there is data with a RCV_DATE of 10/31 since I can run an SQL on it. If I add a +1 to the end of your formula, I will get all the data.
I don't really understand that, but it works. Maybe has something to do with my RCV_DATE being date/time field right down to the millisecond.

Linda Linda
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top