# Database Discussions > Sybase >  Query Correct

## Cynthia

is the follow ing query correct
select a.recv_doc_id as a,b.remit_nbr as b ,c.remit_nbr as c ,a.bal_amt as d,a.recv_doc_date as e
from recv_doc a, remit_recv_alloc_activity b, remit c
where
(c.remit_nbr =* b.remit_nbr and
a.recv_doc_id = b.recv_doc_id )and
a.recv_doc_date > &#39;1998-01-01&#39; and
a.bal_amt = 0


group by a.recv_doc_id,c.remit_nbr
having
a.recv_doc_id is not null and
b.remit_nbr is null

----------

