Date Problem

Discussion in 'ASP General' started by Jay, Aug 25, 2004.

  1. Jay

    Jay Guest

    I am trying to compare a date in my database to the current date. My SQL
    statement is:

    sqltemp5="select * from users where dateclosed <= '" & date & "'"

    What I am trying to accomplish is exclude records where the dateclosed field
    is older than todays date. Such as if dateclosed = 6/30/2004 then today
    being 08/25/2004 that record should be excluded.

    Any help?
    Jay, Aug 25, 2004
    #1
    1. Advertising

  2. Jay wrote:
    > I am trying to compare a date in my database to the current date. My
    > SQL statement is:
    >
    > sqltemp5="select * from users where dateclosed <= '" & date & "'"
    >
    > What I am trying to accomplish is exclude records where the
    > dateclosed field is older than todays date. Such as if dateclosed =
    > 6/30/2004 then today being 08/25/2004 that record should be excluded.
    >
    > Any help?


    Never ask for help with a query without telling us the type and version of
    database you are using

    Bob Barrows
    --
    Microsoft MVP -- ASP/ASP.NET
    Please reply to the newsgroup. The email account listed in my From
    header is my spam trap, so I don't check it very often. You will get a
    quicker response by posting to the newsgroup.
    Bob Barrows [MVP], Aug 25, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Matt
    Replies:
    1
    Views:
    581
    Matthew Speed
    Nov 8, 2003
  2. Peter Grison

    Date, date date date....

    Peter Grison, May 28, 2004, in forum: Java
    Replies:
    10
    Views:
    3,211
    Michael Borgwardt
    May 30, 2004
  3. Matt
    Replies:
    2
    Views:
    500
    Pete Becker
    Nov 8, 2003
  4. Matt
    Replies:
    3
    Views:
    702
    Richard Heathfield
    Nov 8, 2003
  5. Matt
    Replies:
    11
    Views:
    394
    Aaron Bertrand [MVP]
    Nov 8, 2003
Loading...

Share This Page