Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Apr 2005
    Location
    Ireland
    Posts
    122
    Thanks
    4
    Thanked 0 Times in 0 Posts

    TO_CHAR Format (Oracle 10g)

    Code:
    # Create query
      my $query = qq(SELECT title,
                            description,
                            TO_CHAR(gv_start_date,'DD-MM-YYYY HH24::MM'),
                            TO_CHAR(gv_end_date,'DD-MM-YYYY HH24::MM'),
                            FROM   vote,
                                      group
                            WHERE  vote_id = '$vote_id'
                            AND    group_id = group_code
                            AND    v_active = $ROW_ACTIVE
                            AND    g_active = $ROW_ACTIVE);
    The above query wont return properly formatted dates. The date fields are Date data types in the format (21-Oct-2006 03:44:00 PM) and i want to return values in format (21-10-2006 03:44)

    Any help would be greatly appreciated.

  • #2
    Regular Coder
    Join Date
    Apr 2005
    Location
    Ireland
    Posts
    122
    Thanks
    4
    Thanked 0 Times in 0 Posts
    Code:
    # Create query
      my $query = qq(SELECT title,
                            description,
                            TO_CHAR(gv_start_date,'DD-MM-YYYY HH24::MM'),
                            TO_CHAR(gv_end_date,'DD-MM-YYYY HH24::MM')
                            FROM   vote,
                                      group
                            WHERE  vote_id = '$vote_id'
                            AND    group_id = group_code
                            AND    v_active = $ROW_ACTIVE
                            AND    g_active = $ROW_ACTIVE);
    Fixed it guys, sorry. Was just a extra comma after gv_end_date that should'nt have been there!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •