Tengo este ejemplo.
Código:
SELECT t1.docnum from orden1 T0 INNER JOIN Orden T1 ON T0.DocEntry = T1.DocEntry where T0.ITEMCODE='MONT-01' AND (T0.DISCPRCNT>=1) AND (datediff(day,t1.docdate,getdate())=0) and t1.doctime>'900'