Ask a Question related to Coldfusion Database Access, Design and Development.
-
nitai_co #1
Get the time between first and last record
Hi all,
I have a result table. In the first record I have the start time and in each
record obviously another time then at the last record I have the final time.
All those records have a identical ID.
Now I have to get the time spend between the first and the last record. This
is were I am stuck. Any clues?
Result Table:
ID<tab>value<tab>time
1<tab>A<tab>10:15
1<tab>B<tab>10:20
1<tab>C<tab>10:30
So the time spend here would be for ID "1" 15 minutes.
TIA.
Nitai
nitai_co Guest
-
Show record based on time
I have a record in a DB with a start time and a stop time (their data types are set to datetime). i want to show the record if the current time... -
Time elapsed record
Running FM 5.5 on PC. Is there a way to show elapsed times for each record in table view. I want to show how long a patient has been admitted to... -
Elapsed time record help.
Running FM 5.5 on PC. Is there a way to show elapsed times for each record in table view. I want to show how long a patient has been admitted to... -
unzipping a record at a time
I have successfully used zgrep in a script and loved every minute of it (still wet behind the ears). sub pulldata { my $data = `zgrep $key... -
Time Stamp on a record
I have a subform within a form. When a user creates a new record in the subform, I would like to have the date/time automatically stamped on that... -
jdeline #2
Re: Get the time between first and last record
The ID is identical across all records? That's strange.
Anyway, since the recordset is a collection, you can index it as an array. So
your first record would be
myQuery.time[1]
and your last record would be
myQuery.time[myQuery.RecordCount].
jdeline Guest
-
BKBK #3
Re: Get the time between first and last record
Assume that the entries in the 'time' column are in a datetime
format. If they're not, you can easily convert them. Then you could
try something like
SELECT DATEDIFF(second, MIN(time), MAX(time)) as timeDiff
WHERE ID = 1
This will give the value you are looking for, in seconds.
BKBK Guest
-
jdeline #4
Re: Get the time between first and last record
BTW, "time" is a reserved word in some systems.
jdeline Guest
-
BKBK #5
Re: Get the time between first and last record
>... "time" is a reserved word in some systems.
Yes, we must take JDeline's comment into account.
Therefore, assume that the entries in the 'theTime' column are in a datetime
format. If they're not, you can easily convert them. Then you could
try something like
SELECT DATEDIFF(second, MIN(theTime), MAX(theTime)) as timeDiff
WHERE ID = 1
This should give the value you are looking for, in seconds.
BKBK Guest



Reply With Quote

