dbTalk Databases Forums  

Global variable date can't be added

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Global variable date can't be added in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Thomas Scheiderich
 
Posts: n/a

Default Global variable date can't be added - 06-21-2004 , 04:58 PM






I am trying to add a date as a global variable and no matter what I add, I
get the following error:

Could not convert variable beginExecute from type BSTR to type Date

When I hit the new button it sets up a default as String which I normally
can change to anything else, but if I use date, it doesn't take it. I
assume I need to put an initial date there.

If this is the case, how would I put in, use the current date and time at
time the package starts.

I also need to set up another Global variable "endExecute". What would I
set this to? I want to set this at the end as I am exiting the package.

Thanks,

Tom.



Reply With Quote
  #2  
Old   
Darren Green
 
Posts: n/a

Default Re: Global variable date can't be added - 06-21-2004 , 06:47 PM






In message <10dem51lel994f9 (AT) corp (DOT) supernews.com>, Thomas Scheiderich
<tfs (AT) deltanet (DOT) com> writes
Quote:
I am trying to add a date as a global variable and no matter what I add, I
get the following error:

Could not convert variable beginExecute from type BSTR to type Date

When I hit the new button it sets up a default as String which I normally
can change to anything else, but if I use date, it doesn't take it. I
assume I need to put an initial date there.

If this is the case, how would I put in, use the current date and time at
time the package starts.

I also need to set up another Global variable "endExecute". What would I
set this to? I want to set this at the end as I am exiting the package.

Thanks,

Tom.

I'm guessing that the problems are all around the datetime format of
your machine and the format being used in the string global variable.
Have you tried using an unambiguous, VBScript compatible date. I favour
dd mmm yyyy.

If you are logging start and end of packages or tasks, then why not use
the built in logging that DTS provides. The log to SQL Server options is
the most structured, and easily query able after the event. You can tie
this into your own custom logging as well by using the lineage variables
to get the guid used to log to the built in log tables as well.


--
Darren Green (SQL Server MVP)
DTS - http://www.sqldts.com

PASS - the definitive, global community for SQL Server professionals
http://www.sqlpass.org



Reply With Quote
  #3  
Old   
Thomas Scheiderich
 
Posts: n/a

Default Re: Global variable date can't be added - 06-22-2004 , 12:07 AM



"Darren Green" <darren.green (AT) reply-to-newsgroup-sqldts (DOT) com> wrote

Quote:
In message <10dem51lel994f9 (AT) corp (DOT) supernews.com>, Thomas Scheiderich
tfs (AT) deltanet (DOT) com> writes
I am trying to add a date as a global variable and no matter what I add,
I
get the following error:

Could not convert variable beginExecute from type BSTR to type Date

When I hit the new button it sets up a default as String which I normally
can change to anything else, but if I use date, it doesn't take it. I
assume I need to put an initial date there.

If this is the case, how would I put in, use the current date and time at
time the package starts.

I also need to set up another Global variable "endExecute". What would I
set this to? I want to set this at the end as I am exiting the package.

Thanks,

Tom.


I'm guessing that the problems are all around the datetime format of
your machine and the format being used in the string global variable.
Have you tried using an unambiguous, VBScript compatible date. I favour
dd mmm yyyy.

Actually, no.

I am just just trying to add a global variable that is a date type and it
was rejecting it. I assume it was because I was not putting anything in the
Value field. If I put a value, such as 12/15/05, it works. But if I put
getdate(), null or empty - it doesn't work. How do I set it up to be a null
date?

Thanks,

Tom.

Quote:
If you are logging start and end of packages or tasks, then why not use
the built in logging that DTS provides. The log to SQL Server options is
the most structured, and easily query able after the event. You can tie
this into your own custom logging as well by using the lineage variables
to get the guid used to log to the built in log tables as well.


--
Darren Green (SQL Server MVP)
DTS - http://www.sqldts.com

PASS - the definitive, global community for SQL Server professionals
http://www.sqlpass.org




Reply With Quote
  #4  
Old   
Darren Green
 
Posts: n/a

Default Re: Global variable date can't be added - 06-22-2004 , 04:08 PM



In message <10dff8mcji5dpf3 (AT) corp (DOT) supernews.com>, Thomas Scheiderich
<tfs (AT) deltanet (DOT) com> writes
Quote:
"Darren Green" <darren.green (AT) reply-to-newsgroup-sqldts (DOT) com> wrote in message
news:s6zGQuWAO31AFwlY (AT) sqldts (DOT) com...
In message <10dem51lel994f9 (AT) corp (DOT) supernews.com>, Thomas Scheiderich
tfs (AT) deltanet (DOT) com> writes
I am trying to add a date as a global variable and no matter what I add,
I
get the following error:

Could not convert variable beginExecute from type BSTR to type Date

When I hit the new button it sets up a default as String which I normally
can change to anything else, but if I use date, it doesn't take it. I
assume I need to put an initial date there.

If this is the case, how would I put in, use the current date and time at
time the package starts.

I also need to set up another Global variable "endExecute". What would I
set this to? I want to set this at the end as I am exiting the package.

Thanks,

Tom.


I'm guessing that the problems are all around the datetime format of
your machine and the format being used in the string global variable.
Have you tried using an unambiguous, VBScript compatible date. I favour
dd mmm yyyy.


Actually, no.

I am just just trying to add a global variable that is a date type and it
was rejecting it. I assume it was because I was not putting anything in the
Value field. If I put a value, such as 12/15/05, it works. But if I put
getdate(), null or empty - it doesn't work. How do I set it up to be a null
date?

Thanks,

Tom.
You can't basically. To be honest the typing is Dts is a bit weak,
mainly because it appears to use a variant under the covers. You cannot
convert null to a valid date, therefore it cannot be set is my thinking.
Use a string on this case. If you set a date, then change the type back.
If you do this in code, the type will switch automatically.


--
Darren Green (SQL Server MVP)
DTS - http://www.sqldts.com

PASS - the definitive, global community for SQL Server professionals
http://www.sqlpass.org



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.