Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1064
  • Last Modified:

Oracle: Finding First Sunday of the Year

Hi,

Does anyone know how to find the first sunday (for example) of the year in PL/SQL. Using Oracle 10g.

Thanks,

Iain
0
mullykid
Asked:
mullykid
1 Solution
 
sventhanCommented:
try this...

Select Next_day(To_date('0101'||to_char(:yourdate,'YY'),'ddmmyy'),'sunday') "First Sunday" from dual;
0
 
musalmanERP ConsultantCommented:
Try

next_day('31-Dec-2010', 'SUNDAY')
0
 
mullykidAuthor Commented:
Thanks sventhan. That works great! :)
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
to make it even shorter:

next_day(trunc(sysdate, 'YYYY') -1, 'SUNDAY')
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Tackle projects and never again get stuck behind a technical roadblock.
Join Now