Skip to Content
avatar image
Former Member

Alert query not working based on expiry date

Hi Experts,

I want to set up an alert for a UDF fields in my Sales Order Title based on the date which is put. The field is expiry date and I want that before 7 days of expiry date Alert should pop up. I am using the below query but No Alert is coming which is already set in Alert Management

I also want that 2 alerts should come which is before 7 days and before 15 days of expiry date.

declare @datevar datetime 
select @datevar = getdate()
SELECT T0.[DocNum], T0.[DocDate], T0.[CardCode], T0.[CardName], T0.[DocTotal], T0.[U_LCVal], T0.[U_LCSDate], T0.[U_LCEdate] FROM ORDR T0 WHERE DATEDIFF(DD, T0.U_LCEdate, @datevar) > 7

Please guide what might be wrong.

Regards,

kamlesh

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    avatar image
    Former Member
    Apr 03, 2009 at 08:45 AM

    hi,

    SELECT T0.[DocNum], T0.[DocDate], T0.[CardCode], T0.[CardName], T0.[DocTotal], T0.[U_LCVal], T0.[U_LCSDate], T0.[U_LCEdate] FROM ORDR T0 WHERE DATEDIFF(DD, T0.U_LCEdate, getdate()) <= 7
    OR DATEDIFF(DD, T0.U_LCEdate, getdate()) <= 15

    Jeyakanthan

    Add comment
    10|10000 characters needed characters exceeded