Advertisement
Guest User

Untitled

a guest
Sep 22nd, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
T-SQL 1.14 KB | None | 0 0
  1. use SuperCamps_MSCRM
  2. GO
  3. SELECT distinct    po.new_positiondefinitionidName, co.FullName, co.Address1_Name, co.Address1_Line1, co.Address1_Line2, co.Address1_City, co.Address1_PostalCode,
  4.                       co.new_regionidName, co.Address1_County, co.MobilePhone, co.Telephone2, co.EMailAddress1, co.New_CRBcleared, co.New_Disclosuredate,
  5.                       co.New_Disclosurenumber, co.New_SCCRBsenttoapplicant, co.New_IDcheckedandreturnedtoapplicant, co.New_SCCRBDate, co.New_SCCRBDisclosurenumber,
  6.                       co.New_Reference1returned, co.New_Reference2returned, pr.New_name, co.ContactId,po.New_Employeeover21,po.New_Description
  7. FROM          New_position AS po
  8. INNER JOIN New_scproduct AS pr
  9. ON po.new_productid = pr.New_scproductId
  10. INNER JOIN Contact AS co ON po.new_employeeid = co.ContactId
  11.  
  12. WHERE     --(po.New_Occupiedfrom >= @datefrom) AND (po.New_Occupiedto <= @dateto) AND
  13. pr.New_scproductId = '8381EC4D-D91C-E011-969B-B8AC6F8A2B34'
  14.  
  15. and po.New_positionId in
  16. (
  17. select distinct a.new_positionid from New_attendance as a
  18. where a.New_Date >= '07/18/2011' and a.New_Date <= '07/22/2011' and a.DeletionStateCode = 0
  19. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement