Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^3: Using DBI::Sybase having problem with Date format

by derby (Abbot)
on May 10, 2007 at 17:54 UTC ( [id://614719]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Using DBI::Sybase having problem with Date format
in thread Using DBI::Sybase having problem with Date format

I don't know which columns are dates (so, I'll assume those prefixed with dt are). For your test script, you would have to change from

my $sth = $dbh->prepare_cached( "SELECT * FROM ReleaseDates" );
to
my $sth = $dbh->prepare_cached( "SELECT convert( char(8), dtXXX, 101 ) FROM ReleaseDates" );
for the cgi:
my $sth =$connection->prepare( "SELECT Release, dtTargetFeatureFreeze, dtTargetCCRB, dtTargetReleaseFromDev, dtTargetRTM, TwikiURL, ReleaseNum, Display FROM ReleaseDates WHERE (Display = 1)" );
to
my $sth =$connection->prepare( "SELECT Release, convert( char(8), dtTargetFeatureFreeze, 1), convert( char(8), dtTargetCCRB, 1), convert( char(8), dtTargetReleaseFromDev, 1), convert( char(8), dtTargetRTM, 1), TwikiURL, ReleaseNum, Display FROM ReleaseDates WHERE (Display = 1)" );
-derby

update: BTW, setting dateformat only affects inputting dates.

Replies are listed 'Best First'.
Re^4: Using DBI::Sybase having problem with Date format
by Anonymous Monk on May 11, 2007 at 08:40 UTC
    Derby thank you so much !!! I have used your method on quite a few of my scripts now. Your an absolute legend. Thanks again for all your help. Michael I did try the whole
    $dbh->syb_date_fmt('MDY1_YYYY');
    but it just wouldn't workmaybe it was the way i was trying to include it into my script I will probably try and get it to work if i can. Thank you both for all your help

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://614719]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (2)
As of 2024-04-20 16:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found