thank you, but if you can give me answer to this  exacte probleme, as
mentioned in question

Le dim. 1 déc. 2019 à 18:55, Integr@te System <[email protected]> a
écrit :

> Hi,
>
> here u can try for complex queryset
>
>
>
> https://docs.djangoproject.com/en/2.2/topics/db/queries/#complex-lookups-with-q
>
> On Sun, Dec 1, 2019, 21:08 bill dexter <[email protected]> wrote:
>
>> ELECT a.matr
>>       ,[nom]
>>       ,[prn]
>>       ,cast([dat_nais] as date) as dat_nais
>>   , (YEAR(getdate()) - YEAR(dat_nais)) as age
>>       ,cast([dat_deces] as date) as dat_deces
>>       ,cast([dat_imm] as date) as dat_imm
>>       ,cast([dat_aj] as date) as dat_j
>>       ,[cod_position]
>>   ,YEAR(dat_imm) as anne_imm
>>   ,YEAR(dat_encais) as ann_regl
>>       ,[annee]
>>       ,[cod_nat]
>>       ,cast([dat_e
>>
>> Snc] as date) as dat_regl
>>       ,[mt_encais]
>>   FROM users a
>> left join enca e on e.matr = a.matr
>> left join encr c on (c.cod_encais = e.cod_encais)
>>   where (YEAR(c.dat_enc) - c.annee > 3 ) and ((YEAR(getdate()) -
>> YEAR(a.dat_nais)) between 54 and 70) and c.cod_nat = 'CN'
>>   order by a.nom_, a.prn, c.annee asc;
>>
>> hello;
>> my models are users, enca; encr;
>> who can i performe this query using django ORM, note that i'm using
>> MSSQL; thank very much
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/85f7f91b-0f52-4a96-8700-bee588eb4a3d%40googlegroups.com
>> <https://groups.google.com/d/msgid/django-users/85f7f91b-0f52-4a96-8700-bee588eb4a3d%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAP5HUWqap3ddCEmW-7yD_uRWhwxDNQdSNZ%2BQPPvHzcAwDf1e5Q%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAP5HUWqap3ddCEmW-7yD_uRWhwxDNQdSNZ%2BQPPvHzcAwDf1e5Q%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA7%3DR20i-DNEFTgdHQ7bjmvzQHrmML3LjzamrSiK07oJgbC_%2Bw%40mail.gmail.com.

Reply via email to