Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL to sellect a date

Re: SQL to sellect a date

From: w.f.a. van valenberg <w.v.valenberg_at_hccnet.nl>
Date: Wed, 27 Jan 1999 15:58:56 +0100
Message-ID: <78n9l9$n3q$1@news.hccnet.nl>


One of the reasons might be that your opendate field is filled by for example SYSDATE which also contains the time. The solution is then to truncate your opendate field which only returns the date part.

Try this:
SELECT * FROM tktmaster WHERE trunc(opendate)=TO_DATE('01/26/99', 'MM/DD/YY');

See if it helps.

Wim

Brad McBride heeft geschreven in bericht <36AF1ED0.F171AE43_at_Axom.com>...
>Hi,
>
> I'm currently developing a database that our company will be using to
>power our internal helpdesk. The only thing that I have left to do is
>selecting tickets by date and by a date range. I tried the following
>command:
>
>SELECT * FROM tktmaster WHERE opendate=TO_DATE('01/26/99', 'MM/DD/YY');
>
>and did not get any rows back even though I knew that I should get at
>least 20 different rows. Have I done something wrong with the SQL or do
>I need to do something else in order to select specific tickets that
>were opened on a certain date.
>
>Thanks.
>
Received on Wed Jan 27 1999 - 08:58:56 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US