Jump to content
Sign in to follow this  
oakbridge

Counting Related Records

Recommended Posts

I've got two tables, a Client table and a table that stores changes to the services that they subscribe to. What I am looking for is a field in the clients table that stores the number of records in the changes table that have a field set to 'N'.

I set up two new fields in the clients table. One is where I want to have the count, the other is a Global that contains the value 'N'. For the count, I'm using: Count ( Changes::posted_to_clients )I've also set up a new relationship between the two tables where the keys are Clients::client# equal to Changes::client# AND Clients::globalvalue equal to Changes::posted_to_clients.

When I set this up in one database as a test using 0 and 1 for the posted_to_clients field, it appears to work. Unfortunately this is a legacy system and the current values in the posted_to_clients field are 'Y' and 'N'. Is there a reason why this won't work because it appears to fail. I've tested with both 8.5 and with 9 and get the same results.

Share this post


Link to post
Share on other sites

Hi Steve

It would appear that one of the fields (I suspect the global) is a field with a result of number rather than text. That might explain why it works with 1 and 0 but not 'n'

HTH

Phil

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...

Important Information

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