Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
Christech82
Starting Member
20 Posts |
Posted - 2013-04-13 : 15:40:22
|
How to show hire days I mean I have made this query to get the hire date SELECT MONTHS_BETWEEN(START_DATE,TERMINATION_DATE) DATESFROM CONTRACT;The result should be how many days between the start date and the termination date but I have always wrong result!!!?columns are :START_DATE TERMINATION_DATE---------- ----------------30-JAN-13 20-FEB-13 01-DEC-12 12-FEB-13 02-FEB-12 05-APR-12 10-FEB-10 15-FEB-11 07-JUN-12 10-DEC-12 15-DEC-12 20-DEC-13 |
|
chadmat
The Chadinator
1974 Posts |
Posted - 2013-04-13 : 16:37:43
|
SELECT DATEDIFF(dd, START_DATE, TERMINATION_DATE) DATESFROM CONTRACT-Chad |
|
|
Christech82
Starting Member
20 Posts |
Posted - 2013-04-13 : 16:49:22
|
quote: Originally posted by chadmat SELECT DATEDIFF(dd, START_DATE, TERMINATION_DATE) DATESFROM CONTRACT-Chad
Thank you for your replyDATEDIFF It's not working as I still have this message from oracleError starting at line 40 in command:SELECT DATEDIFF(dd, START_DATE, TERMINATION_DATE)FROM CONTRACTError at Command Line:40 Column:8Error report:SQL Error: ORA-00904: "DATEDIFF": invalid identifier00904. 00000 - "%s: invalid identifier"*Cause: *Action: |
|
|
chadmat
The Chadinator
1974 Posts |
Posted - 2013-04-13 : 17:21:25
|
Looks like you are not using SQL Server.-Chad |
|
|
Christech82
Starting Member
20 Posts |
Posted - 2013-04-13 : 17:43:02
|
quote: Originally posted by chadmat Looks like you are not using SQL Server.-Chad
Yes, I using SQL developer |
|
|
TG
Master Smack Fu Yak Hacker
6065 Posts |
Posted - 2013-04-13 : 22:21:58
|
This forum is specific to MS Sql Server. Try the DBForums site.Be One with the OptimizerTG |
|
|
|
|
|