List:MySQL and Perl« Previous MessageNext Message »
From:amy parness Date:April 10 2004 6:16pm
Subject:variables
View as plain text  
My first if statements are working and adding a 0 before numbers less than
or = to 9 but the second ones (fromdate and todate) are not working. They
are adding the +1 but not the 0 before numbers <=9. Does it have something
to do with it being in () in the main statement?

$x=0

if ($frommonthWidgetValue <= 9)
       {
       $frommonthWidgetValue = $x.$frommonthWidgetValue;
        }  
       if ($fromdateWidgetValue <= 9)
       {
      $fromdateWidgetValue = $x.$fromdateWidgetValue;
        }
        
          
       if ($tomonthWidgetValue <= 9)
       {
       $tomonthWidgetValue = $x.$tomonthWidgetValue;
        }  
       if ($todateWidgetValue <= 9)
       {
      $todateWidgetValue = $x.$todateWidgetValue;
        }
        
        
       $datestart= $x.$fromyearValue.
"-".$frommonthWidgetValue."-".($fromdateWidgetValue+1);
       $dateend= $x.$toyearValue. "-" .$tomonthWidgetValue.
"-".($todateWidgetValue+1);
      
       print $datestart
     

Thread
variablesamy parness11 Apr
  • Re: variablesRandall D. Hobbs11 Apr
    • Re: variablesJamie McCarthy11 Apr
      • Re: variablesRandall D. Hobbs11 Apr