cancel
Showing results for 
Search instead for 
Did you mean: 

Results table difference when running query from Alert compared to Query Manager

former_member459477
Participant
0 Kudos

Hello,

I have following query - Aim is to create alert to tell employee which customers to make visit to in next 4 weeks

SELECT DISTINCT T1.CardName, T1.U_VisitDue, T1.U_VisitReason, T1.U_Priority, T1.U_Region as 'Area', T1.U_VNotes

FROM dbo.OCRD T1

WHERE DateDiff(d,T1.U_VisitDue, GETDATE()) <29

Group BY T1.CardName, T1.U_VNotes, T1.U_VisitDue, T1.U_VisitReason, T1.U_Priority, T1.U_Region

FOR BROWSE

My problem is that when I run query through alert the field U_VNotes is displayed differently.

Running the query from Query Manager the contents of this field appear in one field of the result table.

Running the query via Alery the content of this field is split into several fields in results table according to 'new line' in field entry.

This makes the results table from the Query less 'user-friendly' because if you want to sort the table by 'Date' column for example it makes a mess of the table because of the extra rows.

I want results table to look like top version in picture below ... but i want to run from alert.

Is this possible?

How can I achieve it?

Thanks for any assistance

Regards, Karen

Accepted Solutions (1)

Accepted Solutions (1)

agustin_marcoscividanes
Active Contributor
0 Kudos

Hi

check this support note:1774628 The SQL SELECT DISTINCT Statement does not work in ALERTS

Kind regards

Agustín Marcos Cividanes

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Karen,

Have you tried without Distinct? You have Group By in the end. Distinct is no need here.

Thanks,

Gordon

kothandaraman_nagarajan
Active Contributor
0 Kudos

Hi,

It is an application error from 2007 A and 9.0 version as per above SAP note.

There is no solution/workaround stated in above note.

Thanks & Regards,

Nagarajan