Showing posts with label Oracle SQL Query for two timestamp difference. Show all posts
Showing posts with label Oracle SQL Query for two timestamp difference. Show all posts

Oracle SQL Query for two timestamp difference

Below query where given to Sysdate is between two TimeStamp

to_char(AF_AN_S, 'DDMMYYYY HH24:MI'),      AF_EET,     trim(FT_NAME) as AVT_NAME,     AC_REG,      FLB_PAX,      FLB_INF,     P_NAME,    
P_VNAME,      CLG_ACD_CODE,     P_LTR_CODE,     P_PERS_NR,      P_NR   
from     IBSDBA.MV_ACT_FLIGHT,IBSDBA.MV_AIRCRAFT,
IBSDBA.MV_FL_TYP,    
IBSDBA.MV_FLT_ART,
IBSDBA.MV_FLT_BLNG,IBSDBA.MV_VP_FLIGHT_ASSIGN,     
IBSDBA.MV_CREW_LOG, IBSDBA.MV_PERSONAL    
where      P_OWNER = 'TUI'    
and     CLG_P_PERS_NR = P_PERS_NR   
and     VAS_SEQ = CLG_VAS_SEQ    
and     VAS_AF_ID = AF_ID  
and AF_AB_S between TO_TIMESTAMP ('05.04.2012:03:00:00','DD.MM.YYYY:HH24:MI:SS')
and   TO_TIMESTAMP ('05.04.2012:17:00:00','DD.MM.YYYY:HH24:MI:SS')