Crystal Not-So-Clear

Jul 16, 2009 14:16

I wrote this out in the hopes that I'd figure out a solution once I had it laid before me, but nooooo. So I'm turning to my much smarter readers for advice. /o.o ( Read more... )

work

Leave a comment

Comments 10

terrycloth July 16 2009, 19:37:02 UTC
It sounds like you want more then one table? Because what row the stuff in column 3 appears in isn't related to the data in column 2.

So you'd have two tables for Foo Inc, one with unique loan numbers and one with unique guarantors. Then you arrange them on the page so that they look like one table?

I don't actually know Crystal Reports at all, so...

Reply

rowyn July 16 2009, 19:42:08 UTC
Yes, that's right. I don't know how to get the two tables to line up if I make them different tables, though. >.< Maybe it's something I can do with subreports.

Reply


(The comment has been removed)

rowyn July 16 2009, 19:46:43 UTC
Oooh, pivot tables. I've never played with them before, I'll give it a try. Thanks!

Reply

rowyn July 16 2009, 22:28:30 UTC
The pivot table looks prettier, but, sadly, I can't figure out a way to get it to cut guarantors if they appear attached to another loan (or vice versa), so it's still humonguous. :/ Like Terry said, the problem is that I really want a table of guarantors and a table of loans presented side-by-side because they're ... both ... connected to the same borrower.

... and it occurs to me as I write this that I might be able to fix this by fiddling with my table joins in Crystal. I need to look at that! >.>

Reply


jurann July 16 2009, 21:52:34 UTC
I could do that in Perl, Java or C# - but somehow I don't think that's what you're working with. ;D SQL by itself probably can't do that unless you're using some scripted SQL-fu like Postgres. And now I'm babbling. =D

Reply

Java?! rowyn July 16 2009, 21:58:28 UTC
Curse it! I knew I should've been a real programmer. ;_;

Reply

telnar July 17 2009, 02:21:47 UTC
On the SQL-fu front, what you really want is two select distincts within each borrower with the results merged together. I could do it cleanly (generating one set of output results) using a SQL procedural language (like PL-SQL for Oracle or T-SQL for SQL Server), but here's something in vanilla SQL which doesn't come that far from what you want ( ... )

Reply

rowyn July 17 2009, 03:21:52 UTC
Doing them as distinct lists I can manage. It's the merge part that I can't figure out -- how to get the list of borrwers & loans to line up with the list of borrowers & guarantors. :/

Reply


zaimoni July 17 2009, 04:07:45 UTC
The first way to do this I can think of in procedural SQL uses two temporary tables each with an autoincrement column (the results of the group-by tables you mentioned), and a third temporary table containing the target report. Use the autoincrement column to decide which order to create the rows in the third table, and then do the correct updating.

As for actually massaging it out of an SQL statement: the lightning from Father in Heaven is not present this instant. Please accept my apologies.

Reply


Leave a comment

Up