Hi There,

Well the first and last record of the results.

So if 1000 records were found... then record #1 and then record #1000 -
perform data calculation between those 2 records (how many days does
this query span).

Know what I am trying to say?

Sorry if its not clear.


-----Original Message-----
From: Jason Vincent [mailto:jayv@;nortelnetworks.com] 
Sent: November 13, 2002 12:24 PM
To: Aaron Wolski; [EMAIL PROTECTED]
Subject: RE: [PHP-DB] Difference between 2 dates.. thoughts?

You should be able to do this at the database level - of course you
said what database that is.

Regardless, check your database documentation for the max() and min()
functions - never used these on date but they might work - do you always
want the first record and the last record in the database?  Or do you
the first and last record of the record set?  If you always want the
record inserted and the last record inserted, than use max() and min()
the unique database key (the unique record number) assuming you have one
that they are sequential.

Then check for any date functions that might be able to tell the days
elapsed between to dates (in mySQL you might look at the interval



-----Original Message-----
From: Aaron Wolski [mailto:aaronjw@;martekbiz.com] 
Sent: Wednesday, November 13, 2002 11:33 AM
Subject: [PHP-DB] Difference between 2 dates.. thoughts?

Hi All,
First off I have a query like this:
SELECT dateinserted FROM SiteTrackingTable;
Now. in this query any number of results could be returned 10 or 1000,
Is it possible to take the dateinserted value from the first record and
from the last record and perform some calculation to get the number of
the record spans?
Haven't done something like this before and don't have a clue where to
start. Date sorting,etc I can do just don't know about this one.
Thanks for your help!

PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to