CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> Archive -> GotoCode Archive

 Two Tables One Grid

Print topic Send  topic

Author Message
Sonny
Posted: 11/24/2003, 11:31 AM

Is it possible to display the information from two tables in a single grid?

Table 1 (Events)
EventID
Event
Date
etc...

Table 2 (Holidays)
HolidayID
Holiday
Date
etc...

My goal is to show the Events in order of date and I would like to show the holidays along with the events. I'm not much on SQL but I would think there would be a way to retrieve the data as a single recordset. If this is the wrong approach ring in and give a better way!

Using CCS latest release, ASP, And Access.
Mehmet Ozdemir
Posted: 11/24/2003, 12:47 PM

SELECT EventID, Event, EventDate FROM TABLE1
UNION
SELECT HolidayID, Holiday, HolidayDate FROM TABLE2
Anthony
Posted: 11/25/2003, 10:26 PM


Or perhaps you could create a view from both tables.

hth
Sonny
Posted: 11/26/2003, 5:01 AM

OK:
I tried the sql datasource and created the union. Worked great! Problem is passing in the search criteria from the search form, CCS uses a different approach in the code for sql datasource than table/view datasource and I could not get the defaults on the integers to work to show all the records when no search was given.

So I created a sql query in the database to retrieve all the data and used table/view datasource in CCS to retrieve the sql query. Seems to work great except when I create the where params in the sql builder it won't reconize the database query as a table in the database. But if I create all the parameters by typing them in the grid works fine.

I would assume that this is what you mean by using a view. (Kind of new at this)

   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.