how to display a time range [message #275775] |
Mon, 22 October 2007 11:30 |
deahayes3
Messages: 203 Registered: May 2006
|
Senior Member |
|
|
Help , I dont know how to do this one....
I have a min and max time range in a repeating frame, I am trying to display all the hours in between the min and max time, but I dont know which way to go with this I tried on the data model and creating a function but it doesnt work how I want b/c I am looping through to create the time in between the range, I also tried creating a text field setting it to dsname and placing the below in the format trigger, what am i missing to display the time range. here is my code
thanks in advance
function F_time_rangeFormatTrigger return boolean is
cursor time_cur is SELECT
MAX(TO_char(paint_end_time,'HH24:MI:SS')) maxt --15:00:00
,MIN(TO_char(paint_start_time,'HH24:MI:SS')) mint--07:00:00
FROM time_table_t
WHERE date_of_use = :date_of_use AND site = :p_site
time_rec time_cur%rowtype;
endtime varchar2(25);
vtime date;
time_range varchar2(25);
vstart varchar2(25);
begin
open time_cur;
fetch time_cur into time_rec;
vstart:= time_rec.mint;--7:00:00
Loop
vtime := to_date(vstart,'HH24:MI:SS') + 1/24; --add one hr @ end
endtime:= to_char(vtime, 'HH24:MI:SS');
time_range := vstart||' - '||endtime;
srw.set_field_char(0, time_range);
vstart:= to_char(vtime, 'HH24:MI:SS');-change start time here
exit when vstart = time_rec.maxt;--15:00 = 15:00
end loop;
close time_cur;
return (TRUE);
end;
I want it to look like this if time is between 7:00 to 15:00
then
7:00- 8:00
8:00 - 9:00
9:00 - 10:00
etc
14:00 - 15:00
|
|
|
|
|
|
|
|
Re: how to display a time range [message #277374 is a reply to message #277331] |
Mon, 29 October 2007 16:27 |
|
Littlefoot
Messages: 21823 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
If start and end time change, I believe they change depending on something (for example, employee_id, product_id, ...). Could you expand the table you are using and enter this additional information ("product_id") along with time intervals, and later select those values in the main report query; something likeSELECT i.start_time, i.end_time, t.column_1
FROM interval i, table t
WHERE i.product_id = t.product_id
AND ...
ORDER BY i.start_time
And, really, what might this global temporary table be?
Also, is upgrading Developer Suite to a more recent version feasible solution to you?
|
|
|
|
Re: how to display a time range [message #277591 is a reply to message #277578] |
Tue, 30 October 2007 13:13 |
|
Littlefoot
Messages: 21823 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
... and there's no chance for downloading an XLS file. Sorry. Post a screenshot (JPG or PNG) or a pure TXT file instead. Or, even better, a test case (CREATE TABLE and INSERT INTO sample data, along with a RDF file) so that we could see what's going on.
Forgot to say ... would a simple SELECT DISTINCT solve that duplicate records problem?
[Updated on: Tue, 30 October 2007 13:14] Report message to a moderator
|
|
|
|
|