0
I got a query
which, apparently, is simple if it weren’t for the fact that I have these two *
Alas, I’m not sure if it’s inner join
, left join
or someone from the same family.
I need to turn this query
for linq to sql
, and the result is not working. Can anyone help me interpret this? I did left join
and it didn’t add up.
select AFENTIDADE.NOMEENTIDADE, NOMEAO, NOMEUTILIZADOR,
MN.DATACRIA, MN.DATAFECHO, MN.NUMFACT,
MN.NUMFOLHA, AESERVICO.TempoEI, HORASA, R.PRECOD
From AEMANUTE MN WITH (NOLOCK), AFENTIDADE WITH (NOLOCK), AREGDOC R WITH (NOLOCK),
UTILIZADORES WITH (NOLOCK), AESERVICO WITH (NOLOCK), AIAREAORGANICA WITH (NOLOCK)
Where (MN.CODENTIDADE=AFENTIDADE.CODENTIDADE
And MN.CODAO=AIAREAORGANICA.CODAO
AND MN.CODAO *=R.CODAO
And MN.numfolha=aeservico.numfolha
And MN.numfact *= R.numfact
And aeservico.codutilizador=utilizadores.codutilizador
AND UTILIZADORES.ANULADO IS NULL
AND
R.coddoc='FM') And
R.STATUS<>'E' And
MN.IdSituacao=5
--or MN.IdSituacao=5)
And
LEFT(MN.datafecho, 10) >='2017-04-01' And LEFT(MN.datafecho, 10) <='2017-04-30'
ORDER BY NOMEAO, NOMEUTILIZADOR, AFENTIDADE.NOMEENTIDADE
Take a look here, I think this is your case: http://stackoverflow.com/questions/983862/sql-server-operator
– Ronan Matos