How do I prevent from losing the first position of a non “0″ field?

15 pts.
Tags:
Concatenate
How do I prevent from losing the 1st position of non "0" field, using this logic: WHERE concat(TRN@DS, concat(substring(concat('00',TRNYDS),2,2), concat(substring(concat('00',TRNMDS),2,2), substring(concat('00',TRNDDS),2,2)))) between

Answer Wiki

Thanks. We'll let you know when a new response is added.

Sorry this keeps crashing on me.

Just this part — year? substring(concat(’00′,TRNYDS),2,2),
assuming that perhaps 2009 is blank9 and 2010 is 10
1. Trim(TRNYDS) will make it 9 or 10 .. no blank
2. CONCAT(’00′,Trim(TRNYDS)) makes it 009 or 0010
3 now you want the substring of the last 2
If you have a left function then
Left(CONCAT(’00′,Trim(TRNYDS)),2)
but you probably don’t have one .. in which case
Substring(CONCAT(’00′,Trim(TRNYDS)),length(CONCAT(’00′,Trim(TRNYDS)) -1),2)

Phil

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following