|
Posted by Hugo Kornelis on 06/01/06 23:14
On 1 Jun 2006 15:54:27 -0700, enzo wrote:
(snip)
>i thing that i must to be a simple LEFT JOIN but it doesn't work in
>Access (i have a web asp page with and access database in this case)...
Hi enzo,
You have asked your question in a SQL Server group. Since you are using
Access, maybe you should try an Access group instead?
>ps/.. my left join code:
>SELECT table1.name, table2.date, table2.amount
>FROM table1 LEFT JOIN table2 ON table1.code = table2.code
>WHERE (((table1.departm)=53) AND ((table2.date)=#2/15/2006#));
For SQL Server, you'd have to change the format for the date constant.
And for each database that supports LEFT JOIN, you'd have to move the
filtering condition for table2.date.
In SQL Server syntax:
SELECT t1.name, t2.date, t2.amount
FROM table1 AS t1
LEFT JOIN table2 AS t2
ON t2.code = t1.code
AND t2.date = '20060215'
WHERE t1.departm = 53
--
Hugo Kornelis, SQL Server MVP
Navigation:
[Reply to this message]
|