He visto una pregunta sobre como calcular el día de la semana de un campo fecha por SQL, hay varias sentencias que te solucionan el problema:

1. DAYOFWEEK: Calculates the day of week (1=Sunday ... 7=Saturday) from any date field

2. DAYOFWEEK_ISO: Calculates the day of week according the ISO definitions (1=Monday ... 7=Sunday)

3. DAYNAME: Determines the name of the week day (Monday ... Sunday) The daynames are stored in a message file, that's why it can be used for each language On a German OS for example it will return (Montag ... Sonntag)

4. WEEK: Calculates the week no., January, 1st is always in week 1

5. WEEK_ISO: Calculates the week no. according the ISO definitions.

A week starts always with Monday. The first thursday of a year is always in week 1. January, 4th is always in week 1.

Espero, que a pesar del retraso, os sea de interés.

Saludos a todos.

 



____________________________________________________
Únete a Recursos AS400, nuestra Comunidad ( http://bit.ly/db68dd )
Forum.Help400 © Publicaciones Help400, S.L.

Responder a