Re: Another Oracle sqlplus question

  • From: Jim Dunleavy <jim.dunleavy@xxxxxx>
  • To: programmingblind@xxxxxxxxxxxxx
  • Date: Fri, 25 Jul 2008 13:14:15 +0100

Hi,

The problem with using between with dates in Oracle is that the
dates can also include a time particularly if they are populated
using the sysdate function.
e.g. where my_date between '2008-07-01' and '2008-07-31' won't
catch values on 31 July after midnight.
You could do:
  where my_date between '2008-07-01' and '2008-07-31:23:59:59'
to get around that issue.

--Jim
----- Original Message -----
From: Octavian Rasnita <orasnita@xxxxxxxxx>
To: <programmingblind@xxxxxxxxxxxxx>
Sent: Friday, July 25, 2008 6:20 AM
Subject: Re: Another Oracle sqlplus question


> You can also use
>
> where su.pay_end_dt between 'start date' and 'end date'
>
> Octavian
>
> ----- Original Message -----
> From: "Eileen Lafond" <Eileen.Lafond@xxxxxxxxxxx>
> To: <programmingblind@xxxxxxxxxxxxx>
> Sent: Thursday, July 24, 2008 9:53 PM
> Subject: Another Oracle sqlplus question
>
>
> Hi,
> Can someone help me figure out how to correct the following error message:
>
> where su.pay_end_dt = (> '25-DEC-07'and < '15-APR-08')
>                        *
> ERROR at line 15:
> ORA-00936: missing expression
>
>
>
> I cannot seem to find an example of the correct syntax.
>
> Thanks for any help,
>
> Eileen La Fond
> Phone (206) 386-0011
> e.mail Eileen.LaFond@xxxxxxxxxxx
>
> __________
> View the list's information and change your settings at
> //www.freelists.org/list/programmingblind
>
> __________
> View the list's information and change your settings at
> //www.freelists.org/list/programmingblind
>

----------------------------------------------------------------------------
"Information in this email (including attachments) is confidential.  
It is intended for receipt and consideration only by the intended recipient.
If you are not an addressee or intended recipient, any use, dissemination,
distribution, disclosure, publication or copying of information contained in
this email is strictly prohibited.  Opinions expressed in this email may be
personal to the author and are not necessarily the opinions of the HSE.

If this email has been received by you in error we would be grateful if you 
could immediately notify the ICT Service Desk by telephone at +353 1 6352757 
or by email to service.desk@xxxxxxxxxxxx and thereafter delete this
e-mail from your system"
----------------------------------------------------------------------------
__________
View the list's information and change your settings at 
//www.freelists.org/list/programmingblind

Other related posts: