Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Last Record Set..

Status
Not open for further replies.

NotSQL

Technical User
May 17, 2005
205
GB
Can anyone help me with this. Everything seems to work ok until it needs to populate the new table with the last record set. Any ideas would be most appreciated.

Function Main()

If DTSSource("ConNo")&DTSSource("")&DTSSource("Month") = DTSDestination("CNo")&DTSDestination("Year")&DTSDestination("Month") Or _ 'When Values are the same

'First Record Test
IsNull(DTSDestination("CNo")&DTSDestination("Year")&DTSDestination("Month")) then

'Assign Values to ContractNo, Year and Month

DTSDestination("CNo") =DTSSource("ConNo")
DTSDestination("Year")=DTSSource("Year")
DTSDestination("Month")=DTSSource("Month")

'Load data from the current data source record to destination column

Select Case DTSSource("Type")

Case "I "
DTSDestination("Income") = DTSSource("Value")

Case "C "
DTSDestination("Cost") = DTSSource("Value")

End Select

'Assign transformation status to skip insert
Main = DTSTransformStat_SkipInsert
Else
Main = DTSTransformStat_SkipFetch

End If


End Function


Function PostSourceMain()
On Error Resume Next

DTSLookups("InsertLR").Execute _
DTSDestination("CNo"),_
DTSDestination("Year"),_
DTSDestination("Month"),_
DTSDestination("Cost"),_
DTSDestination("Income")

If Err.Number <> 0 Then
Msgbox cstr(Err.Number) & " " & Err.Description
PostSourceMain = DTSTransformstat_Error
Else
PostSourceMain = DTSTransformstat_OK
End If

End Function

Cheers
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top