date function
Moderators: chulett, rschirm, roy
Is the output also varchar? If so, might do what you want.
Field(In.String,'-',1) takes everything from the beginning of the string to the first '-', i.e. "1" in your example
'00':"1" makes a string "001"
Right("001",2) makes a 2 long string, "01"
Field(In.String,'-',2,2) takes the last 2 fields delimited by '-', in this case "dec-2012"
and finally they are all concatenated to "01-dec-2012".
Code: Select all
Right( '00':Field(In.String,'-',1),2):'-':Field(In.String,'-',2,2)
Field(In.String,'-',1) takes everything from the beginning of the string to the first '-', i.e. "1" in your example
'00':"1" makes a string "001"
Right("001",2) makes a 2 long string, "01"
Field(In.String,'-',2,2) takes the last 2 fields delimited by '-', in this case "dec-2012"
and finally they are all concatenated to "01-dec-2012".
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>