Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 specific query

Author  Topic 

ilimax
Posting Yak Master

164 Posts

Posted - 2005-03-28 : 12:33:00
I want to make one specific query which I will use with ADO for pulling data in my VB application.

Should be something like this;
Select a,b,c from Table1 where c between 'from_date' and 'to_date' and b not in (select b from table 2 where c betwen from_date and to_date);


Besically, there are 2 related table and I want to pull data from table1 for the period that I do not have any data in table2 for related record)

ilimax
Posting Yak Master

164 Posts

Posted - 2005-03-28 : 13:14:37
Sorry, I found solution ...Thanks ...!!!

sql = "SELECT tblVacSick.DateR, tblVacSick.EmpID, tblVacSick.FullName, tblVacSick.VacSick, tblVacSick.Hours, tblVacSick.Note From tblVacSick WHERE (((tblVacSick.DateR) Between '" & fdate & "' And '" & tdate & "') AND ((tblVacSick.EmpID) Not In (Select EmpID from ClockP where PDate Between '" & fdate & "' And '" & tdate & "' )));"
Go to Top of Page
   

- Advertisement -