cancel
Showing results for 
Search instead for 
Did you mean: 

Alert for Credit Limit

Former Member
0 Kudos

Hi.i want alert,when a customer put any sales order,that sales order Doctotal plus customer balance should not exceed the customer credit limit.I tried it,But it show all the sales order document,i need only current added document.

My Query is this ....

SELECT A.DOCNUM,B.CARDCODE,B.CardName,

A.DocTotal,B.CreditLine'CREDIT LIMIET',B.Balance'A/C BALANCE' FROM ORDR A

INNER JOIN OCRD B ON A.CardCode=B.CardCode

where (A.DocTotal+B.Balance)>B.CreditLine

Please let me know where i am getting wrong.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Dinesh   

Go to Alerts management ..  

  Below Frequency Select as minutes in dropdown list & Type 1 in the empty field & Update

Regards, K.Ramasamy

Former Member
0 Kudos

Hi

I got answer

the query is...

SELECT A.DOCNUM,B.CARDCODE,B.CardName,

A.DocTotal,B.CreditLine'CREDIT LIMIET',B.Balance'A/C BALANCE' FROM ODLN A

INNER JOIN OCRD B ON A.CardCode=B.CardCode

where (A.DocTotal+B.Balance)>B.CreditLine and convert(varchar(10),a.CreateDate,110)= CONVERT(VARCHAR(10),GETDATE(),110)

and a.DocTime>=replace(Convert(nvarchar(5),GetDate(),108),':', '')-1

Thanks for all...

Thanks

dinesh.

kothandaraman_nagarajan
Active Contributor
0 Kudos

Hi,

If you got answer, please close this thread by marking helpful answer.

Thanks.

Former Member
0 Kudos

Hi,

Try:

SELECT A.DOCNUM,B.CARDCODE,B.CardName,

A.DocTotal,B.CreditLine'CREDIT LIMIET',B.Balance'A/C BALANCE' FROM ORDR A

INNER JOIN OCRD B ON A.CardCode=B.CardCode

where (A.DocTotal+B.Balance)>B.CreditLine AND DateDiff(DD, A.DocDate,GetDate())=0

Thanks,

Gordon

Former Member
0 Kudos

HI.

I tried this query , but i want show  last one minute added document.

Thanks

Dinesh