Since SmartCare is a normalized database, all global code fields in any table will only contain the code and in order to display the more user friendly global code description, a function will need to be used as follows

In this example, the MaritalStatus and EmploymentStatus are examples of global codes where just the code is in the Clients table. To display the description of the global codes, a function can be used as shown below:
- Enter ssf_GetGlobalCodeNameById prior to database field enclosed in parentheses

- Next, copy the query and add it to the dataset in MS Visual Studio by right clicking on DataSets and choose Add Dataset

- Select Use a dataset embedded in my report, choose Text for Query Type and copy query text into Query: box and then click OK

- Now the dataset is available under Datasets area of Report Data window

Fields from SQL query created in MS SQL Server Mgmt Studio are now available to insert into report layout in MS Visual Studio