hi Brian,
BCD> I need to write a query that will pull information from table2 if
BCD> information in table1 is older then xdate.
BCD> My laymen example:
BCD> SELECT table2.date, count(table2.name) as count
BCD> WHERE table1.startdate > 2 weeks
BCD> AND table2.submitdate > 2 weeks
BCD> ;
BCD> So i Guess my real questions is how do I determine the age of an entry to
BCD> another table?
Try this :
Select table2.date,count(table2.name) as count
from table1 as t1, table2 as t2
where t1.itemid=t2.itemid -- to link the tables
and t1.startdate>now()-14
and t2.submitdate>now()-14;
Someone corrects me if I'm wrong, I come from the Oracle world...
Dates (or I should say TimeStamps) are stored as floating point values
: the integer part is the number of days since a certain date
(epoch or 01/01/1970 on unix-based databases) and the fractionnal part is the
portion of the day (although I don't know --yet-- how to convert
date2-date1 to an integer, trunc does not work).
HTH
--
Jean-Christophe Boggio
[EMAIL PROTECTED]
Independant Consultant and Developer
Delphi, Linux, Oracle, Perl