[thelist] Dates, ASP and mental health

rudy r937 at interlog.com
Fri Mar 30 19:15:37 CST 2001


> If they are not, e.g. only text fields, I HIGHLY recommend you
> store the info in a date field. It will make your life easier.

hi ryan

gotta agree with this, make them date columns immédiatement et
tout de suite, if not sooner

(just watch out because in sql/server, date fields all come with times, and
if you don't specify the times, you get midnight, which can screw up date
comparisons with SYSDATE which contains the current time...)

if you currently have recognizable dates inside text fields, try converting
them to dates on the fly using the cast or convert function (not sure if
this will work on all character string dates, and i don't gots sql/server
lying around to test it for ya...)

> I am thinking I should record a date range in the database
> instead of a start date and an end date

um, i have good news for you, a start date and an end date *is* how
you store a date range in a database   ;o)

just remember, do *not* try to qualify rows on the web app side, *always*
let the database filter the rows returned

date formats are the trickiest, you just have to get the syntax right, is
all

      where view_date between start_date and end_date

or if they are text fields, then

      where view_date between
          cast(start_date as datetime) and
          cast(end_date as datetime)

or something

and watch out for the time parts


rudy





More information about the thelist mailing list