Hello all,
I have a question regarding Crystal 8.5 and left joins. I am using Crystal against a MS SQL 2000 Database using the native MSSQL OLEDB driver (I think, it's under the More Data Source section when setting the Database location). Notes: the dates are parameters
When I show the SQL query I get this
SELECT
vw_1.ID,
vw_1.DN,
vw_1.DR,
vw_1.DP,
vw_1.DE,
vw_1.RDE,
vw_1.CA,
Table1.NF,
Table1.NL,
Lookup.LookupValue,
Table2.NameFirst,
Table2.NameLast
FROM
DBXX.dbo.vw_1 vw_1,
DBXX.dbo.Table1 Table1,
DBXX.dbo.Lookup Lookup,
DBXX.dbo.Table2 Table2
WHERE
vw_1.Table1ID *= Table1.Table1ID AND
vw_1.LookupID = Lookup.LookupID AND
vw_1.Table2ID = Table2.Table2ID AND
vw_1.DR >= "Jun 4 2004 00:00:00AM" AND
vw_1.DR < "Jun 5 2004 00:00:00AM"
I get a error when I try to view the report in Crystal. If I change to an inner join everthing works, but the results may not be the desired results. If I take this query and run it in a query tool against the database I get an error as well. If I rewrite the query in SQL-92 like this
SELECT
vw_1.ID,
vw_1.DN,
vw_1.DR,
vw_1.DP,
vw_1.DE,
vw_1.RDE,
vw_1.CA,
Table1.NF,
Table1.NL,
Lookup.LookupValue,
Table2.NameFirst,
Table2.NameLast
FROM DBXX.dbo.vw_1 vw_1
LEFT OUTER JOIN DBXX.dbo.Table1 Table1 ON vw_1.Table1ID = Table1.Table1ID
LEFT OUTER JOIN DBXX.dbo.Lookup Lookup ON vw_1.LookupID = Lookup.LookupID
LEFT OUTER JOIN DBXX.dbo.Table2 Table2 ON vw_1.Table2ID = Table2.Table2ID
WHERE
vw_1.DR >= "Jun 4 2004 00:00:00AM" AND
vw_1.DR < "Jun 5 2004 00:00:00AM"
It works fine in the query tool. So I'm wondering if Crystal is screwing up the syntax and if their is a patch for Crystal 8.5 so it will write in SQL-92?
Thanks for any help.
I have a question regarding Crystal 8.5 and left joins. I am using Crystal against a MS SQL 2000 Database using the native MSSQL OLEDB driver (I think, it's under the More Data Source section when setting the Database location). Notes: the dates are parameters
When I show the SQL query I get this
SELECT
vw_1.ID,
vw_1.DN,
vw_1.DR,
vw_1.DP,
vw_1.DE,
vw_1.RDE,
vw_1.CA,
Table1.NF,
Table1.NL,
Lookup.LookupValue,
Table2.NameFirst,
Table2.NameLast
FROM
DBXX.dbo.vw_1 vw_1,
DBXX.dbo.Table1 Table1,
DBXX.dbo.Lookup Lookup,
DBXX.dbo.Table2 Table2
WHERE
vw_1.Table1ID *= Table1.Table1ID AND
vw_1.LookupID = Lookup.LookupID AND
vw_1.Table2ID = Table2.Table2ID AND
vw_1.DR >= "Jun 4 2004 00:00:00AM" AND
vw_1.DR < "Jun 5 2004 00:00:00AM"
I get a error when I try to view the report in Crystal. If I change to an inner join everthing works, but the results may not be the desired results. If I take this query and run it in a query tool against the database I get an error as well. If I rewrite the query in SQL-92 like this
SELECT
vw_1.ID,
vw_1.DN,
vw_1.DR,
vw_1.DP,
vw_1.DE,
vw_1.RDE,
vw_1.CA,
Table1.NF,
Table1.NL,
Lookup.LookupValue,
Table2.NameFirst,
Table2.NameLast
FROM DBXX.dbo.vw_1 vw_1
LEFT OUTER JOIN DBXX.dbo.Table1 Table1 ON vw_1.Table1ID = Table1.Table1ID
LEFT OUTER JOIN DBXX.dbo.Lookup Lookup ON vw_1.LookupID = Lookup.LookupID
LEFT OUTER JOIN DBXX.dbo.Table2 Table2 ON vw_1.Table2ID = Table2.Table2ID
WHERE
vw_1.DR >= "Jun 4 2004 00:00:00AM" AND
vw_1.DR < "Jun 5 2004 00:00:00AM"
It works fine in the query tool. So I'm wondering if Crystal is screwing up the syntax and if their is a patch for Crystal 8.5 so it will write in SQL-92?
Thanks for any help.