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. Advertisements

  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. Advertisements

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:
    846
    Matthew Speed
    Nov 8, 2003
  2. Robin
    Replies:
    2
    Views:
    6,518
    =?Utf-8?B?Sm9obiBTaXZpbGxh?=
    Aug 4, 2004
  3. DC
    Replies:
    5
    Views:
    3,235
    Brendan Reynolds
    Jul 1, 2005
  4. Peter Grison

    Date, date date date....

    Peter Grison, May 28, 2004, in forum: Java
    Replies:
    10
    Views:
    3,804
    Michael Borgwardt
    May 30, 2004
  5. Matt
    Replies:
    2
    Views:
    768
    Pete Becker
    Nov 8, 2003
  6. Matt
    Replies:
    3
    Views:
    946
    Richard Heathfield
    Nov 8, 2003
  7. Matt
    Replies:
    11
    Views:
    659
    Aaron Bertrand [MVP]
    Nov 8, 2003
  8. Une bévue

    problem with date and date/format

    Une bévue, Mar 10, 2006, in forum: Ruby
    Replies:
    3
    Views:
    224
    Une bévue
    Mar 12, 2006
Loading...