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!

Info7 - need a formula for Year (ytd and last full) 1

Status
Not open for further replies.

Kevinski

Technical User
Jan 4, 2001
95
0
0
NZ
Hello

I am cross-tabbing and charting sales by product group for current year to date and last full year.

The datetime field I am calculating from is called Sales_Order.so_processing_date.

What should the formula be?

Presumably once I return the data set I can crosstab and chart by year......
 
Formula for what, filtering the data?

Try posting technical information:

Crystal version
Database/connectivity used
Example data
Expected output

For the record selection try:

Report->Record selection->Record

(
Sales_Order.so_processing_date >= cdate(year(currentdate)-1,1,1)
and
Sales_Order.so_processing_date <= maximum(yeartodate)
)

-k
 
Sorry

Version = Info 7
Connecting to SQL based datawarehouse

Sample data/ Result:


Item 2004 2003
Pens $100 $5000
Pencils $50 $1000

etc

So at the end of January 2005 the column headings for the Years will be 2005 and 2004.

In other words I want to show the customer what he bought last yaer and what his cumulative purchases are for this year

I can do everything except restrict the date of sale to last full year and ytd - unfortunately I'm getting errors using your suggested formula...

({Sales_Order.so_processing_date} >= cdate(year(currentdate)-1,1,1)
and
{Sales_Order.so_processing_date} <= maximum(yeartodate))


usually the 'A number, currency amount, boolean or string is expected here' type error
 
Unfortunately you didn't post what the error was, so it's hard to help.

Where did you place the formula?

That's a VERY old version of Crystal, another important reason to post your software and database version to minimize the amount of time it takes to help you. It may be that it doesn't support the functions used, so try:

({Sales_Order.so_processing_date} >= cdate(year(currentdate)-1,1,1)
and
{Sales_Order.so_processing_date} <= currentdate

Simpler anyway, I sometimes over think these things and forget the obvious.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top