I collect a date from caller which is 4 digits long, it is the month and the year. I want to then send to a stored procedure, but need to get the last 2 digits and send as year and the remainer as month.
If user inputs 212 for Feb 2012, I want to get the last 2 digits, 12 as $year and the remainer as $month this is due to the month might be some times 1 or 2 digits,
if the date is 1012 for Oct 2012 , then it would be a 2 digit $month.
1) Use SQL to get sub string - leverage your SQL DB and send it the string and have it break it up for you SUBSTRING ( expression ,start , length )
2) Use undocumenetd campaign function:
x = 0, y = 2 !GetSubString($VAR,0,3) = 10
x = 2, y = 2 !GetSubString($VAR,1,2) = 12
Is there a get variable length function in CCA? Maybe after I get user input values, I can check for the length, if it is 3 , then I do a substring of 0,1 and another of 2,2 for else if length is 4, I do the 0,2 and 2,2 instead?
Its funny how CCA ignores a leading 0 in the get !GetStringLength($VAR) function. If I input 0412 for april of 2012 as the date, it says the length is 3 even though I entered 4 digits, would that be a bug with them or is there a way to specify not to ignore the leading 0.
Yes, the SPOC is workiing now, testing with direct sending of data works fine, but when getting the data from user is what I'm now working on.
We're getting a 4 digit date which is the one I need to send as substrigs of a variable. Unfortunatelly, CCA only gets 3 digits if the leading number is a 0, I will try go get the legnth of the variable which will be 3 even if the number entered is 0212, and if its 3, I'll get substring 2 and 12 and then add a leading zero to the first.