Hi
It all depends what data you have in $row{CONTACT_DATE}.
Simon
On Fri, 2004-03-05 at 23:14, Laurie Vien wrote:
> 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
--
Simon Windsor
Eml: [EMAIL PROTECTED]
Tel: 01454 617689
Mob: 07960 321599
--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Mailscanner thanks transtec Computers for their support.