Home » Developer & Programmer » Forms » date problem
date problem [message #275581] Sun, 21 October 2007 22:44 Go to next message
fam_bila
Messages: 43
Registered: August 2007
Location: pakistan
Member
hi,
my problem is

i want to select dates between two dates
for this if i use function
"subtract two dates"
then what should be in select and from clauses.

is there anyother method to find it.

thanx

[Updated on: Sun, 21 October 2007 22:46]

Report message to a moderator

Re: date problem [message #275589 is a reply to message #275581] Sun, 21 October 2007 23:16 Go to previous messageGo to next message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
Subtracting two dates will give you an answer in 'days'. For a range in the 'where' clause use 'between'.

David
Re: date problem [message #275594 is a reply to message #275581] Mon, 22 October 2007 00:08 Go to previous messageGo to next message
jyotipandit2000
Messages: 2
Registered: September 2007
Junior Member


there is method to retrive date between to dates
ex.. select current_date from (table) where current_date between from_date and to_date
Re: date problem [message #275595 is a reply to message #275589] Mon, 22 October 2007 00:12 Go to previous messageGo to next message
fam_bila
Messages: 43
Registered: August 2007
Location: pakistan
Member
If i use between in where clause then what should be in select and from clauses

 select .....
from .....
where ..... between '17-oct-2007' and '22-oct-2007'


as data(dates) are not selected from any user table.
Re: date problem [message #275600 is a reply to message #275595] Mon, 22 October 2007 00:51 Go to previous message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
I do not understand the problem that you are trying to solve! Select the fields that you want from the table in which they reside.

Also, '17-oct-2007' is not a DATE. It is the string representation of a DATE. Use 'to_date' to turn your strings into usable date fields.

David
Previous Topic: menu created & Create menu (merged by LF) merged
Next Topic: help for win_api_shell.winhelp
Goto Forum:
  


Current Time: Wed Dec 07 02:40:06 CST 2016

Total time taken to generate the page: 0.11446 seconds