Hi guys,
Apologies for imposing on your time, but I have an issue which I would please like some help with.
I am now starting SQL for the first time and am getting something of a "crash course" (ie thrown in deep end
).
My task now is to recreate a banking message by writing the code, and then having it output to a text file. This I am able to for the simple parts, but now I have to format a payment senders address so that it adheres to the following banking format rules:
A sample address would be:
Mrsmithblah12345
Smithincorporated
Smithstreet. 5
2222 Smithsville
BUT, some addresses may be longer than that... so I would need to specify that no matter how long the address, it MUST fit to 4 lines and 35 characters maximum.
By way of example, my code is currently:
SELECT Top 10 '#A10' +CHAR(13)+
'<02>007005' +CHAR(13)+
'<03>'+Test_Ref +CHAR(13)+
'<15>GBP' +CHAR(13)+
'<16>'+CONVERT(varchar( 8 ), GETDATE(), 112) +CHAR(13)+
'<17A>747,15' +CHAR(13)+
'<18>002470' +CHAR(13)+
'<31I>UK3900702210055337528' +CHAR(13)+
So, my question... what code would I need to write in the next line of code (it must follow directly on from what is pasted below) in order to do that?
Thanks for any advice you can give!![Smile :) :)](/styles/default/xenforo/vbSmilies/Normal/smile.gif)
Apologies for imposing on your time, but I have an issue which I would please like some help with.
I am now starting SQL for the first time and am getting something of a "crash course" (ie thrown in deep end
![Big Grin :D :D](/styles/default/xenforo/vbSmilies/Normal/biggrin.gif)
My task now is to recreate a banking message by writing the code, and then having it output to a text file. This I am able to for the simple parts, but now I have to format a payment senders address so that it adheres to the following banking format rules:
- 4 lines of 35 characters maximum
A sample address would be:
Mrsmithblah12345
Smithincorporated
Smithstreet. 5
2222 Smithsville
BUT, some addresses may be longer than that... so I would need to specify that no matter how long the address, it MUST fit to 4 lines and 35 characters maximum.
By way of example, my code is currently:
SELECT Top 10 '#A10' +CHAR(13)+
'<02>007005' +CHAR(13)+
'<03>'+Test_Ref +CHAR(13)+
'<15>GBP' +CHAR(13)+
'<16>'+CONVERT(varchar( 8 ), GETDATE(), 112) +CHAR(13)+
'<17A>747,15' +CHAR(13)+
'<18>002470' +CHAR(13)+
'<31I>UK3900702210055337528' +CHAR(13)+
So, my question... what code would I need to write in the next line of code (it must follow directly on from what is pasted below) in order to do that?
Thanks for any advice you can give!
![Smile :) :)](/styles/default/xenforo/vbSmilies/Normal/smile.gif)
Last edited: