Hi,
I wanted to do a select statement in code by using the predicat bucket and filtering but I can not figure out how to "translate" my select statement into the correct calls.
fx how do i do multible inner joins and how do i compare one table field to another table field.
I got irritated
and did a stored procedure instead, but it must be possible to do this the "nice" way...
My stored procedure is like this:
CREATE procedure dbo.UserWorkingStatus
@UserId varchar(100)
as
SELECT
Company.Name,
Revision.CorrectedDate,
Revision.EditStatus
FROM
bb.Company Company
INNER JOIN bb.Revision Revision ON
Company.RevisionId = Revision.RevisionId
INNER JOIN bb.UserAccess UserAccess ON
Company.CommonCompanyId = UserAccess.CommonCompanyId
WHERE
(Revision.EditStatus = '1' OR Revision.EditStatus = '0')
AND (UserAccess.UserId = @UserId) AND (Revision.CorrectingUserId = @UserId)
GO