View Single Post
Old Jan 9th, 2008, 3:58 PM   #4
Sane
Programming Guru
 
Sane's Avatar
 
Join Date: Apr 2005
Posts: 1,799
Rep Power: 5 Sane will become famous soon enough
Re: Crystal Reporting + VB.Net + SQL

Oh, I see. Sorry I'm not familiar, so I didn't pick up on that it was Crystal syntax.

I see your problem now.

Well, SUM(SUM(Prices) * SUM(Quantites)) won't work either, because if you go back to my previous example, this statement would evaluate to SUM(140), which doesn't make a lick-o' sense.

SUM takes in an array, and produces a sum. Period. So in SUMmary (ahahah ) you can't use the SUM function.

If Crystal offers a way to do a for loop, or nest a lambda function in a generator statament... it would be possible. And it must be possible, or else Crystal would be just plain lousy.

After some searching on Google, I found this link:

http://www.inetsoftware.de/products/...la/syntax.html

So see if you can fiddle around with the for loop. You basically want to translate this to Crystal:

Pseudocode Syntax (Toggle Plain Text)
  1. sum = 0
  2. for i = 0 ... length of the price array-1
  3. sum += price array[i] * quantity array[i]
Sane is offline   Reply With Quote