Results 1 to 3 of 3

Thread: date question

  1. #1
    Join Date
    Sep 2003
    Posts
    2

    Question Unanswered: date question

    in my database i stored information on what time the purchaed were made something like this...

    ItemNo|dateofPurchased
    *********************
    0001 | 12/08/2003
    0002 | 1/24/2002
    0003 | 5/18/2001

    .......

    if i wish to get the itemno that were purchased before year 2002 how do i do it by sql statements???
    thanks....

  2. #2
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    Provided Answers: 1

    Re: date question

    Originally posted by HjF_84
    in my database i stored information on what time the purchaed were made something like this...

    ItemNo|dateofPurchased
    *********************
    0001 | 12/08/2003
    0002 | 1/24/2002
    0003 | 5/18/2001

    .......

    if i wish to get the itemno that were purchased before year 2002 how do i do it by sql statements???
    thanks....
    The answer depends on your DBMS. For Oracle you would say:

    select itemno
    from xxx
    where dateofpurchased < TO_DATE('01-JAN-2002','DD-MON-YYYY');

    But TO_DATE is Oracle-specific.

  3. #3
    Join Date
    Sep 2003
    Posts
    2
    i using sql server2000..., so anyone know how to retreive it...?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •