![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi, I want to add a variable on a datetime, i try this : ********************************************** Option Explicit Function Main() dim ctps dim duree ctps = DTSSource("dtstempsdeb").Value duree = DTSSource("dtscallduration").Value DTSDestination("ctemps").Value = ctps.Add(duree) Main = DTSTransformStat_OK End Function ********************************************* DTSSource("dtstempsdeb") as datetime DTSSource("dtscallduration") as int DTSDestination("ctemps") as datetime But it returns => " Object require 'ctps' " It's a simple VBscript so what's wrong ? Rgds Flora. |
#3
| |||
| |||
|
|
Hi In your example ctps and duree are treated as variants as per the decleration. thats the reason, ctps.Add(duree) is not permitted. regards, Chandra "Flora Pho" wrote: Hi, I want to add a variable on a datetime, i try this : ********************************************** Option Explicit Function Main() dim ctps dim duree ctps = DTSSource("dtstempsdeb").Value duree = DTSSource("dtscallduration").Value DTSDestination("ctemps").Value = ctps.Add(duree) Main = DTSTransformStat_OK End Function ********************************************* DTSSource("dtstempsdeb") as datetime DTSSource("dtscallduration") as int DTSDestination("ctemps") as datetime But it returns => " Object require 'ctps' " It's a simple VBscript so what's wrong ? Rgds Flora. |
#4
| |||
| |||
|
|
This alternative seems to be false too : Function Main() DTSDestination("ctemps") = DTSSource("dtstempsdeb").AddSeconds (DTSSource("dtscallduration")) Main = DTSTransformStat_OK End Function AddSeconds method is not treated So have you a suggestion ? "Chandra" wrote: Hi In your example ctps and duree are treated as variants as per the decleration. thats the reason, ctps.Add(duree) is not permitted. regards, Chandra "Flora Pho" wrote: Hi, I want to add a variable on a datetime, i try this : ********************************************** Option Explicit Function Main() dim ctps dim duree ctps = DTSSource("dtstempsdeb").Value duree = DTSSource("dtscallduration").Value DTSDestination("ctemps").Value = ctps.Add(duree) Main = DTSTransformStat_OK End Function ********************************************* DTSSource("dtstempsdeb") as datetime DTSSource("dtscallduration") as int DTSDestination("ctemps") as datetime But it returns => " Object require 'ctps' " It's a simple VBscript so what's wrong ? Rgds Flora. |
#5
| |||
| |||
|
|
What about DATEADD("s",Cint(DTSSource("dtscallduration")),CDa te(DTSSource("dtstempsdeb"))) -- Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP) www.SQLDTS.com - The site for all your DTS needs. www.SQLIS.com - SQL Server 2005 Integration Services. www.Konesans.com "Flora Pho" <FloraPho (AT) discussions (DOT) microsoft.com> wrote This alternative seems to be false too : Function Main() DTSDestination("ctemps") = DTSSource("dtstempsdeb").AddSeconds (DTSSource("dtscallduration")) Main = DTSTransformStat_OK End Function AddSeconds method is not treated So have you a suggestion ? "Chandra" wrote: Hi In your example ctps and duree are treated as variants as per the decleration. thats the reason, ctps.Add(duree) is not permitted. regards, Chandra "Flora Pho" wrote: Hi, I want to add a variable on a datetime, i try this : ********************************************** Option Explicit Function Main() dim ctps dim duree ctps = DTSSource("dtstempsdeb").Value duree = DTSSource("dtscallduration").Value DTSDestination("ctemps").Value = ctps.Add(duree) Main = DTSTransformStat_OK End Function ********************************************* DTSSource("dtstempsdeb") as datetime DTSSource("dtscallduration") as int DTSDestination("ctemps") as datetime But it returns => " Object require 'ctps' " It's a simple VBscript so what's wrong ? Rgds Flora. |
![]() |
| Thread Tools | |
| Display Modes | |
| |