Jump to content

This topic is 8537 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I have a file of orders.

I have a second file of ordered items.

The ordered items records have a orderID which is matched to ID key in the orders file.

I need to display a count of the number of items in a given order.

So if you order 3 pieces, and if I am looking at one of the pieces you ordered, I need a field to tell me how many other pieces you requested with the item I am viewing.

Basically this just involves counting the number of other ordered items with the same orderID and to put that into a calculated field.

I can't think of how I would do that...

Thanks.

I hope this isn't totally dumb.

-wald

Posted

Think I understand your problem here!

If you simply want to count a number of related records in another file do the following:

In your client DB you have the client Bob Brown

Use a client ID to link (create a relationship) to an ORDER database (Lets call this relationship “orders” wink.gif" border="0 (Make sure that at least one field in your order database always has a value – lets say “OrderDate” wink.gif" border="0

Using this relationship you can now create orders, show them in portals etc., etc., etc.,

Now create a calculating field called ClientOrderCount – which would look like this:

Count(orders::OrderDate)

This calculation will show the total number of orders placed by Bob Brown, based on the relationship “orders”

Now! To show the same information in your “order” database – if that’s what you want – , you need to create a self-relationship using the client ID (lets call this relationship “orders_self_link” and then use a very similar calculating field:

Count(orders_self_link::OrderDate)

If I’ve understood you correctly, this will do it!

Rigsby

This topic is 8537 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.