Tuesday, March 20, 2012

Problems with mimimum value for DateTime Package Variable since SP1

Since I've installed SP1 the minimum value for a package variable has changed.

The former version used 12/30/1899 as the minimum value that can be entered.
Now the min value has changed to something about 1960.

During package execution I'd like to distinguish between two states:

1. The Variable has not yet been written to.
2. Any of my executable has written to it.

At the moment I check the value of it to be the minimum value (see above) or not.
So if I develop packages under SP1 I get into trouble.

Any way out of it?
Thanks
Fridtjof

[EDIT] The mindate in C# differs from both date values mentioned above! Consistency? Hum![/EDIT]

How did you determine that you can't put values below 1960 in there? I (or more accurately Darren who is sat right next to me) has just typed the value 01/01/1900 into the variables window and it sems to take it OK.

What specifically are you not able to do?

-Jamie

|||

Typing works fine, and the following code worked too.

Public Sub Main()

Dts.Variables("Variable").Value = DateTime.MaxValue
System.Windows.Forms.MessageBox.Show(Dts.Variables("Variable").Value.ToString())

Dts.Variables("Variable").Value = DateTime.MinValue
System.Windows.Forms.MessageBox.Show(Dts.Variables("Variable").Value.ToString())

Dts.TaskResult = Dts.Results.Success

End Sub

|||Oops, I don't really know what went wrong but it works as you mentioned.

Sorry for posting too quick...

No comments:

Post a Comment