On May 11, 2005, at 10:42 AM, Reidy, Ron wrote:

Read the Oracle docs ... Character functions

Or, from the perl end, check out the module Date::Format. If you are using a
database that allows formatting of date strings (like Oracle, with 'TO_CHAR')
that is probably the easiest way to go. But if you need something more generic,
you'd have to build something with the awkward and obscure SQL standard
function EXTRACT (that's assuming it's supported in your DB), or do the
formatting in perl, using Date::Format (or similar, I think there are a couple other
modules around as well - check out cpan.org).



-----Original Message-----

From: Denesa K Shaw [mailto:[EMAIL PROTECTED]
Sent: Wednesday, May 11, 2005 6:17 AM
To: [email protected]
Subject: Select Statements using a Formatted Date

Hi, How do get the date to be in the format like this?  mm/dd/yyyy
hh24:mi:ss
When I run this code It prints:      START TIME: 01-JAN-05, END TIME:
02-JAN-05

Thanks in advance!

Here is what I have:

my $sql = qq{SELECT MIN(RELOAD_FILE_TS),MIN(RELOAD_FILE_TS)+ 1 FROM
T_RELOAD WHERE LAST_ATTEMPT_TS IS NULL};
my $sth = $dbh->prepare( $sql );
$sth->execute();

my($starttimeStamp,$endtimeStamp);
$sth->bind_columns( undef,\$starttimeStamp,\$endtimeStamp);
##$sth->bind_columns(":fmt","mm/dd/yyyy hh24:mi:ss");

while( $sth->fetch() )
{
  print "START TIME: $starttimeStamp, END TIME: $endtimeStamp\n";
}

$sth->finish();

}






Reply via email to