Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Optional Date parameter in string format

Status
Not open for further replies.

aproddut

Programmer
Oct 29, 2002
15
US
hello,
I have a string parameter which has an edit mask to accept date as dd-mon-yy . This is an optional parameter.

I have the following formula which formats the parameter
NumberVar dd;
NumberVar mm;
NumberVar yyyy;
StringVar text_mmm;


dd := ToNumber(Left ({?Docket End Date},2));
text_mmm := Mid ({?Docket End Date},4,3);
yyyy := ToNumber(Right ({?Docket End Date},4));


if text_mmm = "JAN"
then mm := 01
else
if text_mmm = "FEB"
then mm := 02
else
if text_mmm = "MAR"
then mm := 03
else
if text_mmm = "APR"
then mm := 04
else
if text_mmm = "MAY"
then mm := 05
else
if text_mmm = "JUN"
then mm := 06
else
if text_mmm = "JUL"
then mm := 07
else
if text_mmm = "AUG"
then mm := 08
else
if text_mmm = "SEP"
then mm := 09
else
if text_mmm = "OCT"
then mm := 10
else
if text_mmm = "NOV"
then mm := 11
else
if text_mmm = "DEC"
then mm := 12;

date(yyyy,mm,dd);



How can i avoid the formula to execute if no value is entered in the parameter.

Any tips are appreciated
 
How can i avoid the formula to execute if no value is entered in the parameter.

Code:
If ( {?Docket End Date} <> &quot;&quot; ) Then
insert above code here
Code:
End If


Good Luck! [thumbsup2]
WindUp
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top