April 7, 2009 at 8:45 am
That's it, but I've got a sneaky suspicion that the CAST has to be to VARCHAR, otherwise the zero prefix won't work.
SELECT ReviewDate, Hub, BankNumber, BranchNumber, AccountNumber =
RIGHT('00000000000000000' + CAST(CAST(AccountNumber AS BIGINT) + 1 AS VARCHAR(18)), 18)
FROM Ex_ItemsException
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
April 7, 2009 at 8:53 am
Thanks, Chris. That syntax looks good to me.
The link on the bottom of your posts is incorrect. It should be http://www.sqlservercentral.com/articles/Best+Practices/61537/
I finally read it and apologize for my post, but didn't want to accidentally show any confidential information. Thanks again for your help.
April 7, 2009 at 9:06 am
Chris Morris (4/7/2009)
jbuttery (4/7/2009)
Thanks for the replies guys. I'll try suggestions. I can do a SELECT, but not sure how to manipulate data and then insert.Post the select, Flo will show you how to do the rest ๐
Hi Chris!
Thanks for covering me! I've been in a conference call...
๐
Greets
Flo
April 7, 2009 at 9:42 am
jbuttery (4/7/2009)
Thanks, Chris. That syntax looks good to me.The link on the bottom of your posts is incorrect. It should be http://www.sqlservercentral.com/articles/Best+Practices/61537/
I finally read it and apologize for my post, but didn't want to accidentally show any confidential information. Thanks again for your help.
It works, I checked it ๐
You're welcome, thanks for pointing out the error in my link, and good luck!
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
April 7, 2009 at 9:44 am
No worries Flo. I wondered where you'd got to - you were right on the ball, then disappeared:w00t:
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
Viewing 5 posts - 16 through 19 (of 19 total)
You must be logged in to reply to this topic. Login to reply