>>How i can fine the missing dates. e.g In my dates field, there are dates like this. 01-01-2008,02-01-2008,03-01-2008,05-01-2008,.........
>>I can fine the date 04-01-2008 from my records.(may many dates can be miss. thanks
>
>Create a cursor, fill it with all dates int the period you want to test and then JOIN both tables. i.e you want to test period from 01/01/2008 to 31/12/2008:
>
>CREATE CURSOR crsTest (Dt date)
>ldStartDate = DATE(2008,1,1)
>DO WHILE ldStartDate <= DATE(2008,12,31)
> INSERT INTO crsTest VALUES (ldStartDate)
> ldStartDate = ldStartDate + 1
>ENDDO
>INDEX ON Dt TAG crsTest
>
>SELECT crsTest.Dt AS MissingDates;
>FROM crsTest;
>LEFT JOIN YourTable ON crsTest.Dt = YourTable.DateField;
>WHERE YourTable.DateField IS NULL;
>INTO CURSOR crsMising
>BROWSE NORMAL
>
Borislav,
I just found this
http://blog.sqlauthority.com/2008/04/22/sql-server-better-performance-left-join-or-not-in/ Very interesting.
If it's not broken, fix it until it is.
My Blog