If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ANSI SQL > As of Date Function

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-18-03, 10:14
mprog mprog is offline
Registered User
 
Join Date: Aug 2003
Posts: 6
As of Date Function

I have the following function that I am using on a report for as of date:

------------------------------------------------------------------------------
function getAsOfDate(p_current_date in date) return date;
------------------------------------------------------------------------------
is
y_date date;

begin
y_date := TO CHAR(x, 'MM/DD/YYYY');

IF TO_CHAR(SYSDATE,'DY') = 'MON'
THEN
y_date = SYSDATE - 3
return(y_date);
ELSE
y_date = SYSDATE - 1
return(y_date);
END IF;

end;

How could I make the AsofDate Monday through Friday, but when it sees a Friday, it also looks at Saturday and Sunday's date for comparison on another function.

Any help is greatly appreciated.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On