dbTalk Databases Forums  

inclusive date query

comp.database.oracle comp.database.oracle


Discuss inclusive date query in the comp.database.oracle forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Bob
 
Posts: n/a

Default inclusive date query - 02-16-2004 , 04:56 PM






Hve tble with date field.

the query prompts the user for the dates ( inclusive):
query is
select name, datesold from table where datesold >= '12-Feb-2004' and
datesold <= '15-Feb-2004'


The query returns data from the 12, 13, and 14. but not from the 15th.

What is the syntax for the query to have data from the 15th included.
TIA



Reply With Quote
  #2  
Old   
Ron
 
Posts: n/a

Default Re: inclusive date query - 02-16-2004 , 06:17 PM







Hello Bob,

Can you check if you have data from the 15th?

Try to use "select name, datesold from table where datesold =
'15-Feb-2004' to check.

Regards,

Ron
DBA Infopower
http://www.dbainfopower.com
Standard disclaimer:
http://www.dbainfopower.com/dbaip_ad...isclaimer.html




"Bob" <bob_NOSPAM_ (AT) e-wpm (DOT) com> wrote

Quote:
Hve tble with date field.

the query prompts the user for the dates ( inclusive):
query is
select name, datesold from table where datesold >= '12-Feb-2004' and
datesold <= '15-Feb-2004'


The query returns data from the 12, 13, and 14. but not from the 15th.

What is the syntax for the query to have data from the 15th included.
TIA





Reply With Quote
  #3  
Old   
SteveE
 
Posts: n/a

Default Re: inclusive date query - 02-16-2004 , 07:39 PM



Bob wrote:

Quote:
Hve tble with date field.

the query prompts the user for the dates ( inclusive):
query is
select name, datesold from table where datesold >= '12-Feb-2004' and
datesold <= '15-Feb-2004'


The query returns data from the 12, 13, and 14. but not from the 15th.

What is the syntax for the query to have data from the 15th included.
TIA


if datesold has a time, then it will only work on the 15th for exactly
midnight (00:00).

Try using TRUNC(datesold) to strip any times.

Steve


Reply With Quote
  #4  
Old   
Yaroslav Perventsev
 
Posts: n/a

Default Re: inclusive date query - 02-17-2004 , 10:24 AM



Hello!
Try this:
select name, datesold from table where datesold >= '12-Feb-2004' and
datesold < '16-Feb-2004'

Best regards,
Yaroslav.


"Bob" <bob_NOSPAM_ (AT) e-wpm (DOT) com> сообщил/сообщила в новостях следующее:
news:403152c2 (AT) news (DOT) splitrock.net...
Quote:
Hve tble with date field.

the query prompts the user for the dates ( inclusive):
query is
select name, datesold from table where datesold >= '12-Feb-2004' and
datesold <= '15-Feb-2004'


The query returns data from the 12, 13, and 14. but not from the 15th.

What is the syntax for the query to have data from the 15th included.
TIA





Reply With Quote
  #5  
Old   
clearex@istar.ca
 
Posts: n/a

Default Re: inclusive date query - 02-19-2004 , 08:37 AM



Wouldn't it be easier to use BETWEEN? BETWEEN is inclusive.

"select name, datesold from table where datesold between '12-Feb-2004'
and '15-Feb-2004'


On Tue, 17 Feb 2004 19:24:09 +0300, "Yaroslav Perventsev"
<p_yaroslav (AT) cnt (DOT) ru> wrote:

Quote:
Hello!
Try this:
select name, datesold from table where datesold >= '12-Feb-2004' and
datesold < '16-Feb-2004'

Best regards,
Yaroslav.


"Bob" <bob_NOSPAM_ (AT) e-wpm (DOT) com> сообщил/сообщила в новостях следующее:
news:403152c2 (AT) news (DOT) splitrock.net...
Hve tble with date field.

the query prompts the user for the dates ( inclusive):
query is
select name, datesold from table where datesold >= '12-Feb-2004' and
datesold <= '15-Feb-2004'


The query returns data from the 12, 13, and 14. but not from the 15th.

What is the syntax for the query to have data from the 15th included.
TIA





Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.