Showing posts with label Oracle. Show all posts
Showing posts with label Oracle. Show all posts

Wednesday, August 5, 2015

ORACLE SQL BETWEEN two dates




SELECT * FROM ps_job
WHERE emplid = '00000000000'

  and action_dt between to_date('10/01/2014','mm-dd-yyyy') and to_date('06/30/2015','mm-dd-yyyy')


Thursday, September 4, 2014

ORA-00907 Missing Paranthesis error

PROBLEM:  SSIS package fails  with ORA-00907 error even though the query can be successfully parsed in the data flow task.

POSSIBLE SOLUTION:  Remove all of the comments from the query.

----------------------------------------------------------------------------------------

Sound stupid, I know, but try it anyway.

Friday, May 9, 2014

Oracle MONTHS_BETWEEN

Why don't you just use MONTHS_BETWEEN Function? Doesn't that help?
SQL> SELECT sysdate FROM Dual;

SYSDATE
---------
01-JUN-09

SQL> SELECT MONTHS_BETWEEN (SYSDATE,
  2                         TO_DATE ('01/01/2009', 'DD/MM/YYYY')
  3                        ) diff_in_months
  4    FROM DUAL;

DIFF_IN_MONTHS
--------------
             5

SQL>

Monday, April 28, 2014

Oracle Month function


SELECT LAST_NAME, FIRST_NAME, ORIG_HIRE_DT, BIRTHDATE, extract(month from BIRTHDATE)
from ps_pwc_employees
where pwc_mktcls_descr = 'Philadelphia Metro'
and  extract(month from BIRTHDATE) =5