View Single Post
  #4 (permalink)  
Old 10-29-09, 10:47
flyboy flyboy is offline
Registered User
 
Join Date: Mar 2007
Posts: 510
Quote:
What do you think?
You are making things unnecessarily difficult. Why not simply
Code:
correct_week := to_char(vt_datetime + 1, 'iw');
? For every day except Sunday, the following day (VT_DATETIME +1) belongs to the same ISO week as the day. So you may use the following day for every day in week.

By the way, the correct assignment from SQL query in PL/SQL is by using SELECT INTO statement. You may use CASE statement directly; alternatively IF THEN ELSE statement is available too.
All these statements (with correct syntax) are described in PL/SQL User's Guide and Reference.
Reply With Quote