Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Database Alias Question

Status
Not open for further replies.

DVFS

Programmer
Sep 21, 2000
44
US
Crystal Reports 8.5 / Using DBF's

I am trying to to do a report that shows a list of users for each department in my company. It involves using identical database names and table names (eight to be exact). I have gotten as far as creating aliases for each database and adding each "users" table to the report. However, when I run the report it will only display one list of users. It will also display any duplicate names that appear in multiple departments.

I have tried removing the linking to keep each separate but it did not work. Is there any way to create aliases for tables? Any help would be appreciated.

Thanks, Joe
 
I don't think that you need to set aliases for the databases. The easies way that I know of is to add the table as many times as needed when creating the report. Crystal will give you a warning...

"The Table "DatabaseName.TableName" has already been added to this report with alias "TableName". Do you really want to add another alias to this table?"

If you click "YES", Crystal will then prompt you to create an alias name for the table.

If you want to alias a table that you already have in the report, go to DATABASE --> SET ALIAS...
Highlight the table that you want to alias and then click on "Set Alias".
 
I actually made a mistake at the end of my post, I was wondering if aliases could be set for fields not the tables. I have already set one for the table and I drop the "users" field onto the report and when I run it only one of the eight users fields shows up with any data. Sorry for the mistake.
 
The field doesn't need an alias, because the field name inlcudes the table alias. Select the field and look in the lower left corner of your screen. It will show you the alias and the field name.

You have eight tables?
One table per user or one per department?
One record per user?
Are you trying to append the records from each table into one long set of records? Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
We are using Goldmine, we have 8 different executables which in turn has 8 users.dbf files. The users.dbf holds a list of users names for Goldmine and log in/out times. I'm trying to report on inactivity of users. Most names are unique however some are found in multiple lists. When I right-click on the report and browse the field data the entire list with correct data shows up. However, when I run the report only the names that appear on the multiple lists show up. No unique names tho. I am not trying to append the records just have them show up by department.

Thanks, Joe
 
Let me give you a simple example. Pretend you have 2 tables and each table has 5 columns and 8 rows(users). Now you link them together. You expect the same 5 columns with 16 rows (users), 8 from each table. That isn't how linking works. You would get instead 10 columns with 8 rows, and only rows that are in both tables.

Adding tables adds columns not rows. You will need a different report for each DBF, or you will need to append the 8 tables into one DBF. Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
That makes sense, thanks for the help.

Joe
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top