cancel
Showing results for 
Search instead for 
Did you mean: 

Last Sale Date Column in OITM table

Former Member
0 Kudos

Hi,

Why is the Last Sale Date column in the OITM table empty when you execute the query Select * from OITM inspite of there being sales documents created for the different items?

Kind Regards

Sharat

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Sharat,

This column is not updated for many if not all localizations. I believe it is troublesome to update this column by each A/R document.

Thanks,

Gordon

Answers (3)

Answers (3)

former_member541807
Active Contributor
0 Kudos

hi Sharat,

you can use the ff. query depending in your requirements

last Quotation

 SELECT max(T0.[DocDate])
FROM OQUT T0  INNER JOIN QUT1 T1 ON T0.DocEntry = T1.DocEntry 
WHERE T1.[ItemCode] = '[%0]'

Last Sales Order

SELECT max(T0.[DocDate])
FROM ORDR T0  INNER JOIN RDR1 T1 ON T0.DocEntry = T1.DocEntry 
WHERE T1.[ItemCode] = '[%0]'

Last Deleviry

SELECT max(T0.[DocDate])
FROM ODLN T0  INNER JOIN DLN1 T1 ON T0.DocEntry = T1.DocEntry 
WHERE T1.[ItemCode] = '[%0]'

Last Invoice Date

SELECT max(T0.[DocDate]) FROM OINV T0  INNER JOIN INV1 T1 ON T0.DocEntry = T1.DocEntry 
WHERE T1.[ItemCode] = [%0]

regards,

Fidel

Former Member
0 Kudos

Hi Sharat....

Is that necessary to have last Sales date in OITM table......

If yes then you can get it my FMS......

SELECT Max (T0.DocDate) FROM ORDR T0

Apply above query as FMS. This will give you latest sale date.

Regards,

Rahul

former_member186095
Active Contributor
0 Kudos

That is caused by 2 things:

1. your B1 db localization is not supported to use the field last sale date

2. it is used in the future B1 version where currently it is stored there before it appears in the UI

JimM