BETWEEN [message #330854] |
Tue, 01 July 2008 08:45  |
aarti81
Messages: 235 Registered: December 2007 Location: USA
|
Senior Member |
|
|
Hi all
Can i use BETWEEN for two columns which are dates
for example
WHERE CONTRACT_TYPE='On call' and CONTRACT_TYPE BETWEEN SLECTION_DATE AND FRIMSIGN
|
|
|
|
Re: BETWEEN [message #330858 is a reply to message #330854] |
Tue, 01 July 2008 08:49   |
joy_division
Messages: 4963 Registered: February 2005 Location: East Coast USA
|
Senior Member |
|
|
aarti81 wrote on Tue, 01 July 2008 09:45 | Hi all
Can i use BETWEEN for two columns which are dates
for example
WHERE CONTRACT_TYPE='On call' and CONTRACT_TYPE BETWEEN SLECTION_DATE AND FRIMSIGN
|
No!
How can CONTRACT_TYPE be equal to 'On call' and also be between two dates?
What happens when you try it? Couldn't you do that before asking us what would happen?
|
|
|
Re: BETWEEN [message #330861 is a reply to message #330858] |
Tue, 01 July 2008 08:53   |
aarti81
Messages: 235 Registered: December 2007 Location: USA
|
Senior Member |
|
|
joy_division wrote on Tue, 01 July 2008 08:49 | aarti81 wrote on Tue, 01 July 2008 09:45 | Hi all
Can i use BETWEEN for two columns which are dates
for example
WHERE CONTRACT_TYPE='On call' and CONTRACT_TYPE BETWEEN SLECTION_DATE AND FRIMSIGN
|
No!
How can CONTRACT_TYPE be equal to 'On call' and also be between two dates?
What happens when you try it? Couldn't you do that before asking us what would happen?
|
Sorry i didnt mention it, but i got the following message:
ORA-00900 invalid SQL statement
Cause: The statement is not recognized as a valid SQL statement. This error can occur if the Procedural Option is not installed and a SQL statement is issued that requires this option (for example, a CREATE PROCEDURE statement). You can determine if the Procedural Option is installed by starting SQL*Plus. If the PL/SQL banner is not displayed, then the option is not installed.
Action: Correct the syntax or install the Procedural Option.
and what i wanted was the contract_type should be oncall and at the same time it must be between the two date fields 'selection_date and firmsign'
thanks
|
|
|
|
Re: BETWEEN [message #330863 is a reply to message #330862] |
Tue, 01 July 2008 09:00   |
aarti81
Messages: 235 Registered: December 2007 Location: USA
|
Senior Member |
|
|
did i say something wrong? or was i rude, as far as my most is concerned i was polite and was thankful.If you can help please do else dont sit here judging people.
|
|
|
|
Re: BETWEEN [message #330865 is a reply to message #330864] |
Tue, 01 July 2008 09:19   |
aarti81
Messages: 235 Registered: December 2007 Location: USA
|
Senior Member |
|
|
Michel Cadot wrote on Tue, 01 July 2008 09:12 | Quote: | WHERE CONTRACT_TYPE='On call' and CONTRACT_TYPE BETWEEN SLECTION_DATE AND FRIMSIGN
|
This is not a valid statement, it misses at least SELECT and FROM clauses.
And as joy_division said: "How can CONTRACT_TYPE be equal to 'On call' and also be between two dates?".
How could a variable be a string and a date?
Regards
Michel
|
Soory sir
But i want to get in the output all the contract_types that are on call and they should be between these two date fields
selection_date and firmsign.
thnank you
|
|
|
|
Re: BETWEEN [message #330944 is a reply to message #330854] |
Tue, 01 July 2008 21:24   |
sreenu80
Messages: 50 Registered: July 2006 Location: bangalore
|
Member |

|
|
Hi,
Could you please provide some sample data of your table.
what is the data types and of the CONTRACT_TYPE,SLECTION_DATE AND FRIMSIGN.
please provide the sample data like
select CONTRACT_TYPE,SLECTION_DATE,FRIMSIGN from table;
sreenu
[Updated on: Tue, 01 July 2008 21:27] Report message to a moderator
|
|
|
Re: BETWEEN [message #331026 is a reply to message #330944] |
Wed, 02 July 2008 03:16  |
pablolee
Messages: 2882 Registered: May 2007 Location: Scotland
|
Senior Member |
|
|
Quote: | please provide the sample data like
select CONTRACT_TYPE,SLECTION_DATE,FRIMSIGN from table;
|
Rather than supplying the data as the output of a SELECT, supply the data as create table and insert scripts. That way, other people can actually reproduce the scenario on theirown databases and be able to help much more easily.
|
|
|