Solved

SSRS Date formatting

Posted on 2011-09-15
4
386 Views
Last Modified: 2012-05-12
HI Below is my date expression in ssrs.Basically it is giving
the date 20 years from the date of the field I specified.

If the field is todays date which is 15 sep 2011 then it is
returning 15 sep 2031. But I want to return 1 day less which
is 14 sep 2031.

Can any one re-write the expression for me ?

= format(dateadd(dateinterval.Year,20, Fields!AccreditationDate.Value),"dd/MM/yyyy")

Thanks
0
Comment
Question by:gvamsimba
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 11

Accepted Solution

by:
SThaya earned 250 total points
ID: 36543041
Try this ...

=DatePart("D",DateADD("D",-1,Fields!AccreditationDate.Value))&"/"&
DatePart("M",Fields!AccreditationDate.Value)&"/"&DatePart("Y",DateADD("Y",20,Fields!AccreditationDate.Value))
0
 

Assisted Solution

by:gvamsimba
gvamsimba earned 0 total points
ID: 36543299
I have used the below and it works perfectly---

=format(dateadd(dateinterval.Year,20,dateadd(dateinterval.Day ,-1, Fields!AccreditationDate.Value)),"dd/MM/yyyy")
0
 
LVL 21

Expert Comment

by:Alpesh Patel
ID: 36547423
Right Click on Field and open property window.

Select Number Tab and select format as date and also choose options as you like (DD/MM/YY, MM-DD-YYYY etc. etc.)
0
 

Author Closing Comment

by:gvamsimba
ID: 36565553
Thanks
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

SQL Server engine let you use a Windows account or a SQL Server account to connect to a SQL Server instance. This can be configured immediatly during the SQL Server installation or after in the Server Authentication section in the Server properties …
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question