Hi everyone,
I am writing a BAQ and one of the fields I need is the last date a part was purchased. I just want to return one date. Can anybody tell me the table and the syntax for just returning the last date please?
Thank you
Adrian.
Hi Al, thanks for your reply. I am trying to put together a report for all our parts qtys, values etc to run before and after our annual stock check. One of the fields I have been asked to include is the last purchased date. I looked at the purchase adviser as shown in your screen shot, but could not work out how to get the most recent date into the BAQ.
the easiest way to create a subquery based on PartTran table filter it to āPUR-STKā trantype or/and the relevant criteria to your environment i.e. your business task/process rules, then groupby company, partnum, trantype, to return Max. sysdate, this will return the latest transaction date which is in my environment the latest purchase (received to stock) date
this is a custom tracker view i.e calculate, filter and display these values -on the fly- or/and on an intermediate tables i.e. not direct call from any Db tables, that is why you wont be able to call it, you are doing something similar when you use subquery/groupby but to suit your need within your BAQ
Thanks Al, I got it working using your solution. Much appreciated.
Best regards
Adrian.
To play devils advocate ā¦
The max PartTran.SysDate might not be the most recent date.
For example, A PO Receipt is entered on 10/1 with a receipt date of 10/1. Then on 11/1 someone opens up the receipt and makes a ācorrectionā, and then saves it. The SysDate would be 11/1, not 10/1 when it was truly last received.
And to pile on , if you ordered something and havenāt received it yet, you will not see it in PartTran. Maybe PODetail is a better (and smaller) table to use?
Mark W.
To be a back at youā¦
Define āLast Purchasedā ⦠PO created, PO confirmed, PO line updated, Receipt received date, ā¦
I will play in the middle hereā¦
How about RcvDtl tableā¦here you would have the date received as your date to look for getting the latest received record of that part⦠It may appear on a PODetail line but never receivedā¦
and I agree using PartTran should be avoided as much as possible as soo many records to go through vs other tables mentionnedā¦
Pierre