Page 1 of 1

Service Number

Posted: 03 Feb 2012 15:57
by ruhane
I have many individuals who have more than one military service number. When I am searching on-line records I need to know who has a specific service number. How can I get query to show all service numbers for an individual? I use a simple query to show service numbers for all those that have them, but it only shows one number even though an individual has 2 or 3.
Any help would be very appreciated [grin]

ID:5878

Service Number

Posted: 03 Feb 2012 17:16
by Jane
Assuming you are using a Individuals Query, just copy the current service number column and change the index number to 2
and repeat a couple of times.

Service Number

Posted: 03 Feb 2012 20:11
by tatewise
If you are using FH V4 then a Fact Query might be a better solution because it automatically picks up all instances of an Event or Attribute.

For example use the Standard Query called All Facts and in the Result Set click the Fact column header to sort it, and all your Military Service Facts will be listed together.

See the Knowledge Base on Creating a Query at
http://www.fhug.org.uk/wiki/doku.php?id ... ng_a_query
that gives some tips on Fact Queries and multiple instance Facts.

Service Number

Posted: 07 Feb 2012 11:45
by ruhane
Sorry i must be stupid. I have up to 3 service numbers for an individual. No matter what i do any query only gives one service number for any individual. All i want to do is show all service numbers and if individual has more than one then show each one for the individual with his %INDI% next to it. This will enable me to see all service numbers and who they belong to. What am i doing wrong? Do i need to show you a copy of my query? Thanks for your help

Service Number

Posted: 07 Feb 2012 12:04
by Jane
Make sure you are using a 'Fact' query and not an individual one or make sure you have added the additional columns as per my first post incrementing the Event index number.

Service Number

Posted: 07 Feb 2012 14:24
by ruhane
Sorry, if i make the query a fact query, how do i then select service number? Ive tried but there is no column for this.

Service Number

Posted: 07 Feb 2012 14:50
by tatewise
On the Rows tab add a Filter such as:

Condition:   Add if
Expression:  =FactLabel(%FACT%)
or =FactName(%FACT%)
Operator:    matches
Value:         Service Number

Tick the Parameter option and enter a Label: such as Fact Name

The Fact Name Value you enter must match the name of your Fact.
By using the Parameter option you can select any Fact by this method.

The Knowledge Base advice that I mentioned above at http://www.fhug.org.uk/wiki/doku.php?id ... ng_a_query does say the primary Filter probably will be as illustrated above.

Service Number

Posted: 07 Feb 2012 15:30
by ruhane
Thanks, what do i put in column? Im lost

Service Number

Posted: 07 Feb 2012 15:46
by PeterR
You must be using FH v4 to be able to use a Fact Query.  I think you should start with the standard All Facts Query, as recommended earlier, and then click Save as Custom Query... on the Query Menu, and input a new name for your Custom Query.

You can probably leave the entries on the Columns tab as they are for now.  On the Rows tab, you should enter the Filter as specified by tatewise, above.

Service Number

Posted: 07 Feb 2012 16:45
by ruhane
Thank you all very very much!