OK--here's probably the easiest question ever posted on this forum. I can
tell it's Friday night, cuz my brain must be completely shut down. 

I'm reading records from an Oracle database using the DataHash method.  One
of the fields in the records being retrieved is type DATE.  I want to
convert that date to the format YYYYMMDD and print it to an output file.
Here's what I tried:

   while($db->FetchRow())
   {
      %row = $db->DataHash();
      $formatted_contact_date   = sprintf ("%04d%02d%02d",
$row{CONTACT_DATE});
        print "Formatted contact date is $formatted_contact_date.\n";
        .
        .
        .
   }
Output I'm getting from the above is "Formatted contact date is 20040000."
The month and day are always zeroes.  How do I get the date into the format
I want? (I know, I know ... sigh.)

Thanks.

Laurie
Tired Programmer/Analyst        
B&J's   

Reply via email to