Solved

Multple SQL Databases with same Table Names -- Crystal Reports

Posted on 2009-05-12
2
193 Views
Last Modified: 2012-05-06
I am using Crystal Reports to access data in a SQL Express 2008 instance, but my question is more a general SQL quesiton than a Crystal Reports question.

I am presently using "AccessBooks RealTime" to export the data from about 10 QuickBooks files into SQL. "AccessBooks RealTime" does not support importing multiple QuickBooks files into one database, since List ID's are not unique across QuickBooks files.

Presently, I have a database for each QuickBooks file, and the sync is working fine between the QB files, and their respective databases.

What I want to be able to do, is show certain pieces of information from each database, alongside one another. For example, there is an "Accounts" table, which has two fields, "AccountType", and "AccountBalance". I would like to be able to pull this data from databases A, B, and C. Of course, the table name, and the field name is identical on all three databases.

I somehow need to "flag" which database each piece of data is coming from. In the above example, I might want to display Cash Balance by Company. Then I would want to filter where AccountType == Cash, and then show the balance for Company A, Company B, and Company C, all together.

Hopefully that makes sense. Any ideas on how to achieve something like that? Is there any way I could create a view that aggregates all of my various databases into one, with a new field or prefix that specifies what database it is coming from?

I have also looked at qODBC to export QB data to SQL, which appears to be more flexibile, but I would have to write the update statements to migrate the data to SQL manually. Of course, then I could probably add my own prefixes to each table as it is updated, but that seems like a lot of work.
0
Comment
Question by:netmergence
2 Comments
 
LVL 6

Accepted Solution

by:
BALMUKUND KESHAV earned 500 total points
ID: 24371579
Use Database.Tablename in select statement if you are using same tablename from more than one database, use database1.tablename1.AccountType as accounttypeA or database2.tablename2.AccountType as accounttypeB something like that .
or
Make different views for different databases and use filedname as asyoulikefieldname in views and finally use the different views to make a final sql/views.

Bm Keshav

0
 

Author Closing Comment

by:netmergence
ID: 31580841
I knew there would be an easy solution. "select as" fits the bill perfectly. Thanks!
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
sql server insert 12 30
Query group by data in SQL Server - cursor? 3 33
Crystal Reports Licensing Questions 4 9
Syntax for query to update table 2 12
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
I annotated my article on ransomware somewhat extensively, but I keep adding new references and wanted to put a link to the reference library.  Despite all the reference tools I have on hand, it was not easy to find a way to do this easily. I finall…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question