Function to working days

Dúvidas, dicas e truques de SQL, Select, Update, Delete, cláusulas, operações com joins, Funções em SQLs, etc
  

Poston Mon, 24 Apr 2006 11:16 am

Good day to all. I have a little problem and I'm sure someone can help me because this forum is great. I need a function or other routine that tell me if a date is reported or not working day???
valeu Galera:-o:-o
rcruz
Location: Candido Mota

Poston Mon, 24 Apr 2006 12:07 pm

Take a look at this link: http://www.glufke.net/oracle/viewtopic.php?t=22 you can use TO_CHAR to find out the day of the week. (1 = Sunday, 7 = Saturday).
See example:
Code: Select all
SQL> select to_char(sysdate, 'd') from dual;

T
-
2

SQL>
SQL> select case when to_char(sysdate, 'd') in (1,7) then 'FIM DE SEMANA'
  2              else 'DIA UTIL'
  3         end
  4  from dual;

CASEWHENTO_CH
-------------
DIA UTIL

SQL>
SQL> select case when to_char(sysdate+5, 'd') in (1,7) then 'FIM DE SEMANA'
  2              else 'DIA UTIL'
  3         end
  4  from dual;

CASEWHENTO_CH
-------------
FIM DE SEMANA

SQL>
dr_gori
Location: Portland, OR USA

Thomas F. G

Você já respondeu a dúvida de alguém hoje?
http://glufke.net/oracle/search.php?search_id=unanswered

Poston Mon, 24 Apr 2006 2:52 pm

Thanks é .... I'm doing exactly that and for the holidays I created a table and a forms where they record and Bush once my problem.
This forum is the dude. :-o
rcruz
Location: Candido Mota


  • See also
    Replies
    Views
    Last Post


        Return to SQL

        Who is online

        Users browsing this forum: No registered users and 2 guests