compare 2 date ?

compare 2 date ?

Post by Raymo » Thu, 25 Mar 1999 04:00:00

  Here Pick Guru ,
  I'm Lee from Kuala Lumpur ,
  I'm using Universe 7.3.1 running in NCR unix box
 Currently I had some enquiry, there is can I comparing 2 date and add
them out together and later divide it into how many day , month and
year , I can code it in basic , but it look right really complex.. is
there anyway like add_month ? or function to do it ?

Thank for your reply


1. compare multiple dates from multiple tables

I am trying to figure out a way to compare multiple datetime fields
from multiple tables and only select the most recent date.

Lets say I have 5 different (but related)tables called Table1, Table2,
Table3, Table4, and Table5.  Each of these tables has a similar
datetime field which specifies whether or not the record has been
changed (i.e. If a record was modified on 1/1/2001, then it's "DC"
field would have 1/1/2001.  But, if a date has never been modified, it
will have a null value).

What I would like to do is to be able to compare the "DC" field from
each of the 5 tables and to only obtain the most recent date.  If
there are no dates in existence, then the query would return a null

This is relatively easy to do using various programming languages,
like VB, because you can just declare a variable to store the most
recent date value that I want to obtain.  However, I am not so sure
how I could implement this with a SQL query.

Anybody have any ideas about how I could solve this problem?

2. sql server runtime

3. Comparing two dates without time

4. Good book on SANs

5. comparing a date to see if it is greater than a certain number of months

6. Delphi & Sybase

7. comparing 2 dates in a select

8. Compacting and backing up a datafile within an application

9. Tough! Compare two date ranges

10. comparing 2 dates in xsl

11. Problem with comparing converted dates

12. Compare Lastest Date in same Table

13. comparing null dates