Skip to Content
0
Former Member
Sep 10, 2009 at 07:54 AM

Query Help

12 Views

Hi All,

I have a query

Select T0.DocNum, T0.DocDueDate, T0.CardCode,datediff(day,getdate(),T0.DocDueDate) as [Over Due Days]
from dbo.OINV T0
Where DateDiff(DD,T0.DocDate, GetDate()) < 6 and T0.DocTotal > T0.PaidToDate

where i have hardcoded the date difference to 6. But what i need is i want to get the date difference as parameter like

Select T0.DocNum, T0.DocDueDate, T0.CardCode,datediff(day,getdate(),T0.DocDueDate) as [Over Due Days]
from dbo.OINV T0
Where DateDiff(DD,T0.DocDate, GetDate()) < [%0] and T0.DocTotal > T0.PaidToDate

is that possible?

When i execute the above query it is giving error