I need to create a predicate that does the equivalent of the
following:
SELECT SUM(itemPrice) FROM InvItems
WHERE inStore = FALSE;
Sorry, not used to this notation, do I understand correctly that what
you want to obtain is the sum of all the values of itemPrice, over
all invItems for which inStore is false?
Then I would do this in two steps:
1) Create a fetch request that returns an array of all invItems where
inStore is false (That's where the predicate comes in, and it would
really be a simple predicate.
2) Ask the array for the value of the keyPath "@sum.itemPrice".
****
InvItems is the entity
itemPrice & inStore are attributes.
Haris
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden