Skip to Content
0
Dec 08, 2021 at 12:02 PM

Query where docdate contains '0101'

63 Views

Hi,

I made this simple query:

SELECT 
T0.[DocDate], 
T0.[CreateDate], 
T0.[DocNum], 
T0.[CardCode], 
T0.[CardName],  
T0.[Comments],
T0.DocTotal, 
T1.[firstName], 
T1.[lastName]

FROM ORDR T0 LEFT JOIN OHEM T1 ON T0.OwnerCode = T1.empID

WHERE 
T0.[DocDate] =[%0] AND 
T0.[DocStatus] = 'O' 

ORDER BY T0.[CreateDate]

This shows all open order from a specific date.

I need a query that only shows the open orders from 1 january from all years.

It must be something like this but this doesn't work:

 
SELECT 
T0.[DocDate], 
T0.[CreateDate], 
T0.[DocNum], 
T0.[CardCode], 
T0.[CardName],  
T0.[Comments],
T0.DocTotal, 
T1.[firstName], 
T1.[lastName]

FROM ORDR T0 LEFT JOIN OHEM T1 ON T0.OwnerCode = T1.empID

WHERE 
T0.[DocDate] Like '%%0101%%' 
T0.[DocStatus] = 'O' 

ORDER BY T0.[CreateDate]

Someone has the solution for this?

Thanks.