February 27, 2008 at 2:26 pm
OK, OK, I figured it out...
I am an ID10T!
I created the variable but never gave it a VALUE!!!!
Thanks both of you for your help, I appreciate your quick responses.
Greg
February 27, 2008 at 2:28 pm
Sometimes the most simple things are the most difficult. 😉
February 27, 2008 at 9:32 pm
U might have missed to give value to that variable.
Just check .
March 3, 2008 at 8:10 am
hey greg and adamm i have a ques its simple though ....
what is the use of "0 " in that when i tried to execute
right ("0"+ (dt_str,4,1252)right--------
it says invalid column 0...actually y do we use 0 over there nad what is the need of using dt_str ,4,1252 i tried without using that for a select statement it wrks
select right(datepart("yyyy",getdate()),4)
2008 is the o/p
whats the use of that n y we should use zero n y is it saying invalid column 0...plz let me know thkz in adavance...
Thanks,
Chinna
Its the Journey which gives you Happiness not the Destination-- Dan Millman
March 3, 2008 at 8:17 am
If you look at Adam's example, he's using a RIGHT function in conjuction w/ the leading zero to format the date.
@[User::SharePath] +RIGHT("0" + (DT_STR,4,1252) DatePart("yyyy",getdate()),4)+Right("0" + (DT_STR,4,1252) DatePart("m",getdate()),2) +Right("0" + (DT_STR,4,1252) DatePart("d",getdate()),2) + ".txt"
i.e.
20080301 vs. 200831
Tommy
Follow @sqlscribeMarch 3, 2008 at 8:20 am
If you look at Adam's example, he's using a RIGHT function in conjuction w/ the leading zero to format the date.
Yep. I think it makes the naming convention more consistent and legible.
March 3, 2008 at 8:25 am
then why do i get an error as invalid column 0 plz let me know n uhavent said me abt dt_str y do we use that with that i get the o/p so y should i use that...
Thanks,
Chinna
Its the Journey which gives you Happiness not the Destination-- Dan Millman
March 3, 2008 at 8:38 am
brkn eng dif 2 ustd abv b wrs plz stp ko? 😉
--Jeff Moden
Change is inevitable... Change for the better is not.
March 3, 2008 at 8:55 am
hey jeff what i have asked is when i use the "0" in my statement i get an error as invalid column so how can i use that and why should i use the dt_str will you please let me know....i could not understand regarding that ...
Thanks,
Chinna
Its the Journey which gives you Happiness not the Destination-- Dan Millman
March 3, 2008 at 8:58 am
Where are you trying to use this? Adam's example was used in an expression editor.
Tommy
Follow @sqlscribeMarch 3, 2008 at 9:17 am
thkz got it i used in ssms may be that was the problem ...
Thanks,
Chinna
Its the Journey which gives you Happiness not the Destination-- Dan Millman
March 3, 2008 at 9:43 am
😀 this wouldn't work in T-SQL.
in T-SQL - something like -
declare @FormatDateTable table (SomeDateValue datetime)
insert into @FormatDateTable (SomeDateValue) values (getdate())
select right('0' + ltrim(convert(varchar(2),datepart(month,SomeDateValue))),2) + '/' +
right('0' + ltrim(convert(varchar(2),datepart(day,SomeDateValue))),2) + '/' +
convert(char(4),datepart(year,SomeDateValue))
from @FormatDateTable
Tommy
Follow @sqlscribeMarch 3, 2008 at 9:46 am
Yes, it does. 😀
March 3, 2008 at 10:11 am
Perhaps I'm misunderstanding you Adam 🙂 Your not suggesting this expression (SSIS) is valid in T-SQL?
i.e.
@[User::SharePath] +RIGHT("0" + (DT_STR,4,1252) DatePart("yyyy",getdate()),4)+Right("0" + (DT_STR,4,1252) DatePart("m",getdate()),2) +Right("0" + (DT_STR,4,1252) DatePart("d",getdate()),2) + ".txt"
😀
Tommy
Follow @sqlscribeMarch 3, 2008 at 10:32 am
Perhaps I'm misunderstanding you Adam Your not suggesting this expression (SSIS) is valid in T-SQL?
Absolutely not!! :w00t:
I was commenting on your post. I should have put a quote, but I got lazy 😛
Viewing 15 posts - 16 through 30 (of 47 total)
You must be logged in to reply to this topic. Login to reply