Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Problem In Query With GetDate() Funtion

Hi All,

I am having a little problem with a query where I want to set it up as an alert. The problem seems to lie with the getdate function in my query. I want to return all invoices for the current day that have discounts assigned to them however it seems that when I use the getdate function it is not working. Does somebody know how I can get around this please.

Here is my query I wrote in the words not equal as it seems it does not show when I post it.

SELECT     DocNum, CardCode, CardName, DocDate, DocTotal, DiscPrcnt
FROM         OINV
WHERE     (DiscPrcnt "not equal" 0) AND (DocDate = GETDATE())

Former Member
Former Member replied

Try this query

SELECT     DocNum, CardCode, CardName, DocDate, DocTotal, DiscPrcnt
FROM         OINV
WHERE     (DiscPrcnt != 0) AND (DateDiff(dd,DocDate,GETDATE()) = 0)

Jeyakanthan

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question