×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

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

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

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

(OP)
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......

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

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

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

(OP)
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

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

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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close