Project and Portfolio Management Practitioners Forum
cancel
Showing results for 
Search instead for 
Did you mean: 

Portlet with Dates

SOLVED
Go to solution
Highlighted
George_Colsa
Occasional Advisor

Portlet with Dates

Hi Everyone,
I am building a portlet that show me the time sheet lines between two specific dates.

The query works correctly without the dates condition: When the condition is active, the query show an error.

The condition is following:

 

WHERE
KTMG_PERIODS.START_DATE between to_date('[VP.START_DATE]', 'yyyy-mm-dd hh24:mi:ss') AND to_date('[VP.END_DATE]', 'yyyy-mm-dd hh24:mi:ss')

 

Why this condition is not working correctly??? Somebody has idea about the problem???

 

Thanks in advance.

4 REPLIES
Celil
Esteemed Contributor

Re: Portlet with Dates

Hi George,

 

Could you please try without hours definitions and define date format for what is your ragional definitions. Please be careful to notaions:  "." or "/" or "-"

For example I'm using this code:

KTMG_PERIODS.START_DATE between to_date('[VP.START_DATE]', 'dd.mm.yyyy')

 

is it work for you? please inform us.

 

 

PS: Please keep alive our forum via kudos the professionals

Celil

IT Governance Professional
& PPM Solution Architect
George_Colsa
Occasional Advisor

Re: Portlet with Dates

Hi Celil,

I checked the regional settings and the short date format is 21/12/1.

So, I modified the query as follow:

 

AND KTMG_PERIODS.START_DATE between to_date('[VP.START_DATE]', 'dd/mm/yy') AND  to_date('31/12/11', 'dd/mm/yy')

 

and the result is a portlet error:

 

AND KTMG_PERIODS.START_DATE between to_date(&#39;2011-11-30 00:00:00&#39;, &#39;dd/mm/yy&#39;) AND to_date(&#39;31/12/11&#39;, &#39;dd/mm/yy&#39;) <br> AND ROWNUM &lt;= 200

 

 

It appears like the token don't allow take an specific date format.

 

Do you have any idea about the problem???

AlexSavencu
Honored Contributor
Solution

Re: Portlet with Dates

Hi,

You should use to_date('[VP.START_DATE]', 'YYYY-MM-DD HH24:MI:SS).

Cheers
Alex

--remember to kudos people who helped solve your problem
George_Colsa
Occasional Advisor

Re: Portlet with Dates

You are right. THe portlet is working correctly.

 

Thanks!!!!

 

//Add this to "OnDomLoad" event