Displaying parameters chosen using a formula
faq767-5684
Using the help of code mentioned in above FAQ, I wrote a code for displaying date prompt which include range and multiple value selection. datatype for the parameter is "STRING"!
Possible way of user entering the value is select from picklist or typing the date range or multiple values in mm/dd/yyyy.
I dont have problem when user select value from picklist or (LOV).
Problem when user types the value in mm/dd/yyyy especially when starting month > ending month for ex (starting date 10/01/2001 to ending month 06/30/2013) then it will display like "06/30/2013 to 10/01/2001"
Here is the code snippet which is used while user enters the value
//---If user type the Letting Date---
Output:= Output & minimum({?[S_LETDTE]}[Counter])& " to "& maximum({?[S_LETDTE]}[Counter])&chr(13)
I have attached te full code below
----------------------------------
whileprintingrecords;
stringvar Output:="";
numbervar Counter;
For Counter := 1 to ubound({?[S_LETDTE]}) do(
if minimum({?[S_LETDTE]}[Counter])= maximum({?[S_LETDTE]}[Counter]) then
( if (Mid(Minimum({?[S_LETDTE]}[Counter]),1,1)="[")then
Output:= Output & Mid(split(Minimum({?[S_LETDTE]}[Counter]),".")[2],6,2)&"/"& Replace(Right(split(Minimum({?[S_LETDTE]}[Counter]),".")[2],3),"]","/")& Mid(split(Minimum({?[S_LETDTE]}[Counter]),".")[2],2,4)&chr(13)
else
Output:= Output & minimum({?[S_LETDTE]}[Counter])&chr(13)
)
else
( if (Mid(Minimum({?[S_LETDTE]}[Counter]),1,1)="[") and (Mid(Maximum({?[S_LETDTE]}[Counter]),1,1)="[")then
Output:= Output & Mid(split(Minimum({?[S_LETDTE]}[Counter]),".")[2],6,2)&"/"& Replace(Right(split(Minimum({?[S_LETDTE]}[Counter]),".")[2],3),"]","/")& Mid(split(Minimum({?[S_LETDTE]}[Counter]),".")[2],2,4)&" to " & Mid(split(Maximum({?[S_LETDTE]}[Counter]),".")[2],6,2)&"/"& Replace(Right(split(Maximum({?[S_LETDTE]}[Counter]),".")[2],3),"]","/")& Mid(split(Maximum({?[S_LETDTE]}[Counter]),".")[2],2,4)&chr(13)
Else if (Mid(Minimum({?[S_LETDTE]}[Counter]),1,1)="[") and (Mid(Maximum({?[S_LETDTE]}[Counter]),1,1)<>"[") then
Output:= Output & Mid(split(Minimum({?[S_LETDTE]}[Counter]),".")[2],6,2)&"/"& Replace(Right(split(Minimum({?[S_LETDTE]}[Counter]),".")[2],3),"]","/")& Mid(split(Minimum({?[S_LETDTE]}[Counter]),".")[2],2,4)& " to "&maximum({?[S_LETDTE]}[Counter])&chr(13)
Else if (Mid(Minimum({?[S_LETDTE]}[Counter]),1,1)<>"[") and (Mid(Maximum({?[S_LETDTE]}[Counter]),1,1)="[")then
Output:= Output & minimum({?[S_LETDTE]}[Counter])& " to "&Mid(split(Maximum({?[S_LETDTE]}[Counter]),".")[2],6,2)&"/"& Replace(Right(split(Maximum({?[S_LETDTE]}[Counter]),".")[2],3),"]","/")& Mid(split(Maximum({?[S_LETDTE]}[Counter]),".")[2],2,4)&chr(13)
Else
output:= Output & minimum({?[S_LETDTE]}[Counter])& " to "& maximum({?[S_LETDTE]}[Counter])&chr(13)
)
);
left(Output,len(Output)-1)
faq767-5684
Using the help of code mentioned in above FAQ, I wrote a code for displaying date prompt which include range and multiple value selection. datatype for the parameter is "STRING"!
Possible way of user entering the value is select from picklist or typing the date range or multiple values in mm/dd/yyyy.
I dont have problem when user select value from picklist or (LOV).
Problem when user types the value in mm/dd/yyyy especially when starting month > ending month for ex (starting date 10/01/2001 to ending month 06/30/2013) then it will display like "06/30/2013 to 10/01/2001"
Here is the code snippet which is used while user enters the value
//---If user type the Letting Date---
Output:= Output & minimum({?[S_LETDTE]}[Counter])& " to "& maximum({?[S_LETDTE]}[Counter])&chr(13)
I have attached te full code below
----------------------------------
whileprintingrecords;
stringvar Output:="";
numbervar Counter;
For Counter := 1 to ubound({?[S_LETDTE]}) do(
if minimum({?[S_LETDTE]}[Counter])= maximum({?[S_LETDTE]}[Counter]) then
( if (Mid(Minimum({?[S_LETDTE]}[Counter]),1,1)="[")then
Output:= Output & Mid(split(Minimum({?[S_LETDTE]}[Counter]),".")[2],6,2)&"/"& Replace(Right(split(Minimum({?[S_LETDTE]}[Counter]),".")[2],3),"]","/")& Mid(split(Minimum({?[S_LETDTE]}[Counter]),".")[2],2,4)&chr(13)
else
Output:= Output & minimum({?[S_LETDTE]}[Counter])&chr(13)
)
else
( if (Mid(Minimum({?[S_LETDTE]}[Counter]),1,1)="[") and (Mid(Maximum({?[S_LETDTE]}[Counter]),1,1)="[")then
Output:= Output & Mid(split(Minimum({?[S_LETDTE]}[Counter]),".")[2],6,2)&"/"& Replace(Right(split(Minimum({?[S_LETDTE]}[Counter]),".")[2],3),"]","/")& Mid(split(Minimum({?[S_LETDTE]}[Counter]),".")[2],2,4)&" to " & Mid(split(Maximum({?[S_LETDTE]}[Counter]),".")[2],6,2)&"/"& Replace(Right(split(Maximum({?[S_LETDTE]}[Counter]),".")[2],3),"]","/")& Mid(split(Maximum({?[S_LETDTE]}[Counter]),".")[2],2,4)&chr(13)
Else if (Mid(Minimum({?[S_LETDTE]}[Counter]),1,1)="[") and (Mid(Maximum({?[S_LETDTE]}[Counter]),1,1)<>"[") then
Output:= Output & Mid(split(Minimum({?[S_LETDTE]}[Counter]),".")[2],6,2)&"/"& Replace(Right(split(Minimum({?[S_LETDTE]}[Counter]),".")[2],3),"]","/")& Mid(split(Minimum({?[S_LETDTE]}[Counter]),".")[2],2,4)& " to "&maximum({?[S_LETDTE]}[Counter])&chr(13)
Else if (Mid(Minimum({?[S_LETDTE]}[Counter]),1,1)<>"[") and (Mid(Maximum({?[S_LETDTE]}[Counter]),1,1)="[")then
Output:= Output & minimum({?[S_LETDTE]}[Counter])& " to "&Mid(split(Maximum({?[S_LETDTE]}[Counter]),".")[2],6,2)&"/"& Replace(Right(split(Maximum({?[S_LETDTE]}[Counter]),".")[2],3),"]","/")& Mid(split(Maximum({?[S_LETDTE]}[Counter]),".")[2],2,4)&chr(13)
Else
output:= Output & minimum({?[S_LETDTE]}[Counter])& " to "& maximum({?[S_LETDTE]}[Counter])&chr(13)
)
);
left(Output,len(Output)-1)