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)
 Query modification help. :)

Author  Topic 

ready29003
Starting Member

1 Post

Posted - 2006-12-21 : 14:03:59
Hi!

Can you please tell me how to modify the query below so that it DOES NOT include any records from livedb.dbo.PpTimeCards where the field: PaymentStatus is equal to "PENDING"

Thanks!

MR



SELECT
'00000405' AS CompanyCode,
'21112' AS Contract,
SUBSTRING(e.UniquePublicIdentifier, 1, 3) + SUBSTRING(e.UniquePublicIdentifier, 5, 2) + SUBSTRING(e.UniquePublicIdentifier, 8, 4) AS SSNo,
tc.EmployeeName,
DATEADD(dd, 6, tc.TimeCardDateTime) AS PayDate,
ISNULL(tcw.Amount, 0.00) AS Amount
FROM
livedb.dbo.PpTimeCardComputedWithholdings tcw
INNER JOIN livedb.dbo.PpTimeCards tc ON tcw.TimeCardID = tc.TimeCardID
INNER JOIN livedb.dbo.PpEmployees e ON tc.EmployeeID = e.EmployeeID
WHERE
tcw.WithholdingID = '10' AND DATEADD(dd, 6, tc.TimeCardDateTime) = @PayDate
ORDER BY
tc.EmployeeName

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2006-12-21 : 14:18:33
WHERE ... AND tc.PaymentStatus <> 'PENDING'

Tara Kizer
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-12-22 : 00:47:24
If you are new to sql, learn it

http://www.sql-tutorial.net/
http://www.firstsql.com/tutor.htm
http://www.w3schools.com/sql/default.asp

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -