Using SQL Server 2000
Table
PersonID Date
001 11-02-2009
002 11-02-2009
003 11-02-2009
001 12-02-2009
004 12-02-2009
005 12-02-2009
003 13-02-2009
005 13-02-2009
So on…,
I want to display all the Personid by Date wise.
Expected Output
PersonID Date
001 11-02-2009
002 11-02-2009
003 11-02-2009
004 11-02-2009
005 11-02-2009
001 12-02-2009
002 12-02-2009
003 12-02-2009
004 12-02-2009
005 12-02-2009
001 13-02-2009
002 13-02-2009
003 13-02-2009
004 13-02-2009
005 13-02-2009
So on…,
All the Personid should appear by date wise.
I wrote a query in Access
Query
SELECT AllPossibleCardEvents.PersonId FROM ((SELECT p.PersonId, AllDates.CardEventDate FROM (SELECT DISTINCT Date FROM TMP_Cardevent2) AllDates, Tmp_cardevent1 p) AllPossibleCardEvents LEFT OUTER JOIN TMP_cardevent2 Actual ON AllPossibleCardEvents.PersonId = Actual.PersonId AND AllPossibleCardEvents.Date = Actual.Date) )
Above Access Query is Working Fine. But the same result I want to show in SQL also.
How to write a query in SQL?
Need Query Help.