Click to See Complete Forum and Search --> : Ideas on how to create this report


downunder
February 24th, 2006, 06:52 PM
I have an unusual report to create and need some ideas on how to go about creating it.The tables are set out in the following way.
Table 1 contains a single row such as this
|Value1 | Value2 |String|

Table 2 contains multiple records that contains a number of fields per record
The idea of the report is to present the rows of Table 2 where the ID of the record matches Value1 OR Value2. As Table2 contains time stamps as well a time filter option is also required.
The SQL query would resemble something like this
Select * from Table2 where (Table2.Time>={TimeStart} AND Table2.Time < {TimeEnd}) AND (Table2.ID = Table1.Value1 OR Table2.ID= Value2)

I can't think of a way of creating this report. If I link Value1 and Value2 in Table1 to the ID in Table 2 get an AND condition instead of an OR.
Any ideas would be appeciated
Tony.

FaFa
February 25th, 2006, 03:33 AM
Hi,
Nothing impossible in the Programming, just tell me the
Crystal Report Version and the Client Side Software u r using
(VB6/.Net)

FaFa

Pressm
February 25th, 2006, 10:55 PM
Concept:

Use command to split table1 into 2 tables. Table1a, Table1b. Table1a fields = Value1,Time. Table1b fields value2, Time. Now you can use table2 to link 2 tables insead of 1.
Create a formula = if table1a.value<>"" then table1b.value else table1a.value. (That's assuming there is a value in table1a.value or table1b.value). I hope this helps.

downunder
February 27th, 2006, 07:14 AM
Thanks Pressm,
I'll give it a go and see how it works out.
Tony.