John Janssen
John Janssen

Reputation: 323

Crystal Reports - Sum values where another field isn't a certain value

I am attempting to create a report using Crystal Reports which is tied to a dataset. I am using a foxpro connection to retrieve my data. In the table there is an hours field and there is a transaction code field as well as a client field, invoice number, and a few others that are pointless in this case.

Using Crystal Reports I am trying to get a summary of the hours where the Transaction Code is not "NTX".

I am not able to modify my query to exclude "NTX" because I will still need to get a total of all transactions regardless of the transcode.

A SQL query would be:

SELECT Sum(Hours) FROM table WHERE Transaction <> 'NTX'

Any help would be appreciated.

Upvotes: 0

Views: 1332

Answers (1)

craig
craig

Reputation: 26272

Insert a summarized field on fomrula named 'non-NTX hours':

// {@ non-NTX hours}
If {table.transation}<>'NTX" Then
  {table.hours}
Else
  0

Upvotes: 1

Related Questions