[thelist] ASP Date Manipulation

rudy r937 at interlog.com
Tue Mar 19 10:48:01 CST 2002


> Why not put that condition in the Select statement,
> so you don't have to a) return more data than you need,
> and b) don't take time doing the comparison on each record?

scott, i love ya

> I started that way, but when I couldn't get it to work, I switched.
> I guess I'll go back and fix it.

josh, what database?  they all have different date functions

(that's what i like about standards -- so many to choose from)

your original requirement was

     I am trying to show only those records
     where the date is not older than 3 months
     from a date in the database.

if you really mean that, rather than something else involving the current
date, then that date in the database is in a separate table?

   select recdate, otherstuff
      from yourtable
    where
          ( select somedate from sometable ) - recdate < 90

notice that even date arithmetic differs between databases -- in some you
can say 3 months, in others you have a day result to work with...

let me know if you need help

rudy




More information about the thelist mailing list