Hi,
I am working in Crystal report ver 9.
I am joining two tables table1 & table2. I am using Left Outer join and joining "id1" in table1 with "id2" in table2. Also i am trying to join "Datetime1" in table1 with "Datetime2" in table2. Actually, here in the outer join condition, i need to check only the Date of "Datetime1" with Date of "Datetime2". How can i check that in the outer join condition in crystal report9?
When I outer join these two tables by using "Database Expert > Link" in crystal 9, the out put of the query that i get is as below:
select table1.id1. table1.datetime1, table1.field1, table2.field2
from table1
LEFT OUTER JOIN table 2 ON
table1.id1=table2.id2 AND
table1.datetime1 = table2.datetime2
But i am not able to convert the datetime field to Date at the Left Outer Join condition. Actually I am expecting the query to be generated as below after Outer joining table1 & table2:
select table1.id1. table1.datetime1, table1.field1, table2.field2
from table1
LEFT OUTER JOIN table 2 ON
table1.id1=table2.id2 AND
(CONVERT(Varchar(10), table1.datetime1, 101)=CONVERT(Varchar(10), table2.datetime2, 101))
"(CONVERT(Varchar(10), table1.datetime1, 101)=CONVERT(Varchar(10), table2.datetime2, 101))"
part in the above query actually checks ONLY the "Date" of table1.datetime1 and table2.datetime2 and NOT "Datetime" of those fields.
Is it possible to convert datetime field date into date "ON" the Left Outer Join condition itself (not in the where condition)?
Thanks for your help in advance.
Edited by Shan - 07 Oct 2008 at 12:02pm