I am new to visual basic so this might seem like a simple question. I am trying to take a date field and a time field from an as/400 and put it into a smalldatetime field. When I try to use an activex using just the date field or just the time field I get the correct date or time. But when I try combining them I do not get what I'm expecting the time looks correct but the date is way off. Any ideas would be greatly appreciated. I've included the code I've been using.
Dsrddati = 2001-01-28
Dsrdtime = 10.49.00
Time by itself
Function Main()
DTSDestination("TransactionDate"
= cdate(DTSSource("dsrdtime"
)
Main = DTSTransformStat_OK
End Function
result = 2/14/01 10:49:00 AM
Date by itself
Function Main()
DTSDestination("TransactionDate"
= cdate(DTSSource("dsrddati"
)
Main = DTSTransformStat_OK
End Function
result = 1/28/01
Combining both date and time
Function Main()
DTSDestination("TransactionDate"
= cdate(DTSSource("dsrddati"
) + cdate(DTSSource("dsrdtime"
)
Main = DTSTransformStat_OK
End Function
result = 3/16/2102 10:49:00 AM
Dsrddati = 2001-01-28
Dsrdtime = 10.49.00
Time by itself
Function Main()
DTSDestination("TransactionDate"
Main = DTSTransformStat_OK
End Function
result = 2/14/01 10:49:00 AM
Date by itself
Function Main()
DTSDestination("TransactionDate"
Main = DTSTransformStat_OK
End Function
result = 1/28/01
Combining both date and time
Function Main()
DTSDestination("TransactionDate"
Main = DTSTransformStat_OK
End Function
result = 3/16/2102 10:49:00 AM