Hello everyone,
First off, I am not a programmer or database manager or administrator, so I have only an introductory knowledge of SQL. I am using Crystal Reports to report data stored in a SQL Server database. I know I must create a virtual table, which I can do in Crystal Reports, and I can use most of the info available on the web on SQL to create most of the syntax I need. However, there is one thing I don’t know how to do.
There are several fields I use to identify individuals and groups of data within the database. For example, email, work location, and business unit. Within the database, there is a table with one field called UserFieldName. The data in this field are the field names I use to identify individuals. Another table has two fields: UserID and Values. UserID is the key that identifies each individual for which there is data. Values contains all the data that should go in each of the fields listed in UserFieldName. So, all emails, work locations, and business units are all in one field.
I would like to create a virtual table in which: a) there is one record for each UserID, b) the data in UserFieldName becomes the fields in the new table, and c) the appropriate values go into their respective field (e.g. all emails go into the email field, etc.). My biggest problem is that I do not know how to convert data into fields.
Please let me know how to do this. Thank you in advance for your help.
Frank
First off, I am not a programmer or database manager or administrator, so I have only an introductory knowledge of SQL. I am using Crystal Reports to report data stored in a SQL Server database. I know I must create a virtual table, which I can do in Crystal Reports, and I can use most of the info available on the web on SQL to create most of the syntax I need. However, there is one thing I don’t know how to do.
There are several fields I use to identify individuals and groups of data within the database. For example, email, work location, and business unit. Within the database, there is a table with one field called UserFieldName. The data in this field are the field names I use to identify individuals. Another table has two fields: UserID and Values. UserID is the key that identifies each individual for which there is data. Values contains all the data that should go in each of the fields listed in UserFieldName. So, all emails, work locations, and business units are all in one field.
I would like to create a virtual table in which: a) there is one record for each UserID, b) the data in UserFieldName becomes the fields in the new table, and c) the appropriate values go into their respective field (e.g. all emails go into the email field, etc.). My biggest problem is that I do not know how to convert data into fields.
Please let me know how to do this. Thank you in advance for your help.
Frank