...

View Full Version : TO_CHAR Format (Oracle 10g)



tom123
11-27-2006, 12:08 PM
# 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.

tom123
11-27-2006, 12:27 PM
# 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!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum