Skip to Content
0
Former Member
Sep 13, 2010 at 01:09 PM

Adding Sales Employeed Name to Query

19 Views

Hi Guys,

I have this query and would like to add to it the name of the Sales Employee that created the Sales Order, I am relatively certain I need to use the OSLP table to get this information but am not so sure on the JOINS required to add it. Any help would be greatly appreciated.

SELECT T0.DocNum as 'SO No.', T0.DocDate as 'Date', DateDiff(DD, T0.DocDate,

GetDate()) AS 'DayDiff', T0.CardCode as 'Customer Code', T0.CardName as 'Customer Name',

T0.NumAtCard as 'Ref/PO No.', (T0.DocTotal - T0.VatSum) as 'SO Amt'

FROM OINV T0

WHERE

DateDiff(DD, T0.DocDate, GetDate()) >= '1' AND DateDiff(DD, T0.DocDate, GetDate()) <= '7'

Many Thanks Sean