Where do I get relative date list?

I have some of the relative dates such as t-1 = yesterday
w-1 = last week.  Does anyone know where there is a list of all these?
Becky EdwardsEpic Clarity DeveloperAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Dave BaldwinFixer of ProblemsCommented:
I think this page has a lot of what you're looking for.  
http://www.techonthenet.com/oracle/functions/index.php
0
Becky EdwardsEpic Clarity DeveloperAuthor Commented:
Not that I could find.  I tried searching that page for "mb-1" - which is the first day of last month in relative terms.  "T-1" = yesterday, etc.
 
0
Dave BaldwinFixer of ProblemsCommented:
What database or programming language are you using?
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Becky EdwardsEpic Clarity DeveloperAuthor Commented:
I am creating filters in Crystal Reports, that users pick from.  I have attached the code that interprets whatever date the user fills in.
I want the user to be able to specify the start date as the first day of the current month.  
I did not create this code, and I do not understand it.  
There must be a way to say "start this report from the first day of the current month" but I do not know what it is.
Perhaps someone reading the code below can decipher what we are supposed to put in the start date field to get the first day of the current month.
Like I said = I know m-1 is 30 days ago.  mb-1 is the first day of the last month.  What is the first day of the current month?

// Accepts a date as a string in mm/dd/yyyy, yyyy-mm-dd, or
// relative (t-45) format. Returns a standard Crystal date.

local numberVar NRange;
local numberVar NOperator;
local stringVar SInterval;
local stringVar STemp;
local numberVar NPos;

if IsDate({?Interpreted Start Date}) then Date({?Interpreted Start Date})        //If proper Crystal date was entered, don't change
else 
(
    if InStr({?Interpreted Start Date},"+")>0 then NOperator:=1     //Plus or minus?
    else NOperator:=-1;

    STemp:=Replace({?Interpreted Start Date},"+","-");              //Convert + to -, for easier string manipulation

    NPos:=Instr(STemp,"-");

    If NumericText(Mid(STemp,NPos+1)) then             //Extract and make sure valid number
        NRange:=toNumber((Mid(STemp,NPos+1)))
    else NRange:=0;

    if NPos>0 then
        SInterval:=Left(STemp,NPos)                    //Extract first part. Ex. "T" or "W"
    else SInterval:=STemp;

    if Left(SInterval,1)="T" or SInterval="TODAY" then          //Dates relative to Today
        DateAdd("d",(NOperator*NRange),CurrentDate)

    else if Left(SInterval,1)="W" or SInterval="WEEK" then      //Dates relative to this week
        DateAdd("ww",(NOperator*NRange),CurrentDate)

    else if Left(SInterval,2)="MB" then                         //Dates relative to beginning of this month
        DateAdd("m",(NOperator*NRange),
        DateValue(DatePart("yyyy",CurrentDate), DatePart("m",CurrentDate), 1))

    else if Left(SInterval,2)="ME" then                         //Dates relative to end of this month
        DateAdd("m",(NOperator*NRange),
        DateAdd('d',-1,DateAdd('m',1,DateValue(DatePart("yyyy",CurrentDate), DatePart("m",CurrentDate), 1))))

    else if Left(SInterval,1)="M" or SInterval="MONTH" then     //Dates relative to this month
        DateAdd("m",(NOperator*NRange),CurrentDate)

    else if Left(SInterval,2)="YB" then                         //Dates relative to beginning of this year
        DateAdd("yyyy",(NOperator*NRange),DateValue(DatePart("yyyy",CurrentDate), 1, 1))

    else if Left(SInterval,2)="YE" then                         //Dates relative to end of this year
        DateAdd("yyyy",(NOperator*NRange),DateValue(DatePart("yyyy",CurrentDate), 12, 31))

    else if Left(SInterval,1)="Y" or SInterval="YEAR" then      //Dates relative to this year
        DateAdd("yyyy",(NOperator*NRange),CurrentDate)

    else if Left(SInterval,1)="Q" or SInterval="QUARTER" then   //Dates relative to this quarter
        DateAdd("q",(NOperator*NRange),CurrentDate)

    else                                                        // Error trap
        CurrentDate
)

Open in new window

0
Becky EdwardsEpic Clarity DeveloperAuthor Commented:
Still not exactly what I need.  According to that website, I would put in M for current month, but that doesn't work in this formula.
0
Becky EdwardsEpic Clarity DeveloperAuthor Commented:
Using the formula in the code above; and creating parameters "start date" and "end date", you can use the formulas below to set reports to run monthly and always get the dates you need.  I found out the answers and here they are:

Relative dates for relative date formula	
	
mb	first day of this month
me	last day of this month
	
yb	first day of this year
ye	last day of this year
	
wb	first day of the current week
we	last day of the current week
	
t-1	yesterday
w-1	one week ago today
m-1	one month ago today
y-1	one year ago today
mb-1	the first day of last month
me-1	the last day of last month
yb-1	first day of last year
ye-1	last day of last year

Open in new window

1

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Oracle Database

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.