In that case, I am not sure how you will be able to get the cost roll up date, unless there is another table/procedure that rolls up costs.
Thanks,
Kunal
________________________________
From: Ken Williams <
kwilliams@...>
To: "
vantage@yahoogroups.com" <
vantage@yahoogroups.com>
Sent: Wed, October 28, 2009 2:47:55 PM
Subject: RE: [Vantage] Part Costs Last Update
We've never used the costing workbench... we've been on Vantage for nearly 3 years now.
We have the great fortune of being a build-to-order shop, so the engineering workbench & costing workbench haven't been of much interest to us. Perhaps I'm missing something on the costing workbench? It looks to me that that is used to determine standard costs for parts, generally ones you manufacture. Beings ours are unique each time and we use last costing, I don't see how this tool can help us.
From: vantage@yahoogroups .com [mailto:vantage@yahoogroups .com] On Behalf Of Kunal Ganguly
Sent: Wednesday, October 28, 2009 1:39 PM
To: vantage@yahoogroups .com
Subject: Re: [Vantage] Part Costs Last Update
from data dictionary about costpart -
"This table contains a copy of all of the part records available at the time a cost group is created. Each record contains the CostGrp.GroupID as a unique identifier for the cost group to which the cost part set belongs. "
Not sure where I got this info (either this group or epicor support), but this table gets populated when a part is rolled up (Production mgmt | Engineering | Costing workbench). If your table is empty, then I would venture a guess that no part has ever been rolled up in your database using vantage. Did you guys migrate from something else recently?
Thanks,
Kunal
____________ _________ _________ __
From: Ken Williams <kwilliams@intermoun tainelectronics. com<mailto:kwilliams% 40intermountaine lectronics. com>>
To: "vantage@yahoogroups .com<mailto:vantage% 40yahoogroups. com>" <vantage@yahoogroups .com<mailto:vantage% 40yahoogroups. com>>
Sent: Wed, October 28, 2009 2:20:45 PM
Subject: RE: [Vantage] Part Costs Last Update
The CostPart table in our system is empty. Is there something I'm missing? I looked at that table earlier and assumed it was a temp table of some sort, but it appears your SQL query is using it ("FROM costpart").
Ken
From: vantage@yahoogroups .com [mailto:vantage@ yahoogroups .com] On Behalf Of Kunal Ganguly
Sent: Wednesday, October 28, 2009 12:13 PM
To: vantage@yahoogroups .com
Subject: Re: [Vantage] Part Costs Last Update
Ken,
I created a customization in VB for exactly this purpose, but by single part only. This is tied to a button in the part tracker form and displays the result in a text box. This works for the part currently loaded in the part tracker. Please note that my code isint exactly the most efficient code in the world as I am in the process of optimizing this. (You could probably put some aggregation function in the SQL statement itself).
If you were to want a list of parts, then you could probably write a SQL statement (assuming your DB is SQL) which gets the MAX(tran date) and does a GROUP BY(part number) on the costpart DB. You can probably combine that with the parttran DB if you needed transaction data like ADJ, etc.... this could be done very easily in MS Access.... (oops, did i just say that out loud!?!)
Private Sub btnASHShowDates_ Click(ByVal Sender As Object, ByVal Args As System.EventArgs) Handles btnASHShowDates. Click
Dim partNum = edvPartCost. dataView( edvPartCost. row)("partnum" )
If (getDates(partNum) = False) Then
lblASHEffDate. text = "UNKNOWN"
End If
End Sub
Private Function getDates(ByVal partnum as String) as Boolean
Dim ret as Boolean
Dim cnxString as String = "...." ' replace with your connection string
Dim cnxSQL as String = "SELECT groupid, partnum, effectivedate" & _
" FROM costpart " & _
" WHERE partnum = '" & partnum & "'"
Dim cnxCN as SqlConnection
Dim cnxCMD as New SqlCommand
Dim cnxDR as SqlDataReader
Dim str as String = ""
Dim dates() as String
Dim d1 as Date
ret = true
try
cnxCN = New SqlConnection( cnxString)
With cnxCMD
.CommandText = cnxSQL
.Connection = cnxCN
End With
cnxCN.Open()
cnxDR = cnxCMD.ExecuteReade r(CommandBehavio r.CloseConnectio n)
While cnxDR.Read
str += " " & cnxDR("effectivedat e")
End While
dates = Split(str)
dim i as integer
' eff dates first
d1 = CDate("January 1, 1900") ' arbitary date used for comparision
for i = 1 to dates.length - 1
if CDate(dates( i)) > d1 then
d1 = CDate(dates( i))
End if
next
If d1 = CDate("January 1, 1900") Then
lblASHEffDate. text = "NOT SET"
Else
dates = split(d1.tostring( ))
lblASHEffDate. text = dates(0)
End If
catch ex as exception
MessageBox.Show( "Please report this message to an Administrator. Error in getdates: " & ex.message & vbCrLf & vbCrLf & ex.StackTrace)
ret = false
end try
return ret
End Function
Thanks,
Kunal
____________ _________ _________ __
From: Ken Williams <kwilliams@intermou n tainelectronics. com<mailto:kwilliam s% 40intermountaine lectronics. com>>
To: "vantage@yahoogroup s .com<mailto: vantage% 40yahoogroups. com>" <vantage@yahoogroup s .com<mailto: vantage% 40yahoogroups. com>>
Sent: Wed, October 28, 2009 11:51:23 AM
Subject: [Vantage] Part Costs Last Update
I'm trying to generate a report to show parts that haven't had a cost update in X days.
It appears the only way I can do this is through the PartTrans table. I have Part table linked to PartTrans with a last condition. I want to make sure I'm getting only cost updates and not all the other transactions that can occur. I believe I can get this by grabbing any PartTrans of trans type PUR-MTL, PUR-STK or ADJ-CST. Am I missing any?
Alternatively, am I missing some easier way of accomplishing this? PartCost table doesn't have a last transaction date unfortunately.
Thanks,
Ken
[Non-text portions of this message have been removed]
[Non-text portions of this message have been removed]
[Non-text portions of this message have been removed]
[Non-text portions of this message have been removed]
[Non-text portions of this message have been removed]
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
[Non-text portions of this message have been removed]