selectsplat
New member
- Joined
- Oct 5, 2010
- Messages
- 4
- Programming Experience
- 10+
Greetings,
Ok, I am a complete newb to vb.net (or any other ms language), but I've got 10+ years in shell, SQL, perl and php. So, I can handle technical responses to my question.
I'm building an SSiS package in SQL Server 2005, and I have need to build a script in it in VB.net.
I've gotten everything I need to work, but I'm having some trouble comparing some dates. From what I understand, I'm supposed to be able to use datediff.
So, I'm trying to compare the value stored in a system datetime variable against date.now. Here's the snippet from my code...
DateDiff("d", Date.Now(), Dts.Variables("last_run_oracle").Value) <= 1
I get various input data type errors, when I run this.
Just so you know I've thought this through, I've considered the data types of all of the parts of this expression.
First, I understand that the result from the datediff is a string and I've evaluating it against a number. So, that's probably a problem there.
Second, the 'last_run_oracle' variable is a datetime.
I'm not sure what date.now is, but I assume it would be a datetime as well.
And the date part I'm returning is a string, I konw, so it might be that I can't compare two dates adn return a string.
Any help you can provide would be greatly appreciated.
Ok, I am a complete newb to vb.net (or any other ms language), but I've got 10+ years in shell, SQL, perl and php. So, I can handle technical responses to my question.
I'm building an SSiS package in SQL Server 2005, and I have need to build a script in it in VB.net.
I've gotten everything I need to work, but I'm having some trouble comparing some dates. From what I understand, I'm supposed to be able to use datediff.
So, I'm trying to compare the value stored in a system datetime variable against date.now. Here's the snippet from my code...
DateDiff("d", Date.Now(), Dts.Variables("last_run_oracle").Value) <= 1
I get various input data type errors, when I run this.
Just so you know I've thought this through, I've considered the data types of all of the parts of this expression.
First, I understand that the result from the datediff is a string and I've evaluating it against a number. So, that's probably a problem there.
Second, the 'last_run_oracle' variable is a datetime.
I'm not sure what date.now is, but I assume it would be a datetime as well.
And the date part I'm returning is a string, I konw, so it might be that I can't compare two dates adn return a string.
Any help you can provide would be greatly appreciated.