Solved

Multple SQL Databases with same Table Names -- Crystal Reports

Posted on 2009-05-12
2
191 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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
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…

707 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now