Portal Engine Questions on portal engine and web parts.
Version 6.x > Portal Engine > Date Range query in transformation View modes: 
User avatar
Member
Member
paul.truman-sunmed.co - 12/6/2012 6:51:49 AM
   
Date Range query in transformation
Hi, in my news list transformation, I'd like to show a text field that says 'New' if the date the news article was added falls within the past month. Is it possible to do that? I was thinking the 'compare' statement would work but not sure of the code to use to select the past 31 days?

User avatar
Kentico Support
Kentico Support
kentico_janh - 12/7/2012 4:06:29 AM
   
RE:Date Range query in transformation
Hello,

Yes, you can use something like this:

<%# IfCompare(CMS.GlobalHelper.ValidationHelper.GetDateTime(Eval("NewsReleaseDate"), System.DateTime.Now)>System.DateTime.Now.AddMonths(-1), true, "", "NEW") %>


Best regards,
Jan Hermann