Wednesday, August 16, 2017

Oracle date function(Attendance related).

Note : Your database table name  hr_biometricattendancecnt it has one field login_time this query give you first login time and last login time. select to_char(first_login,'HH24:Mi:SS AM')First,to_char(last_login,'HH24:Mi:SS AM') Last from (select min(LOGIN_TIME) first_login,max(LOGIN_TIME) last_login from hr_biometricattendancecnt where trunc(log_date)=trunc(:d) group by trunc(log_date)) Purpose : If you want to get sysdate as your day format like this code will be give you desire. select decode(trim(to_char(to_date(sysdate),'DAY')),'SATURDAY','SAT_DAY','SUNDAY','SUN_DAY','MONDAY','MON_DAY','TUESDAY','TUE_DAY',...