Solved

SSRS Date formatting

Posted on 2011-09-15
4
381 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
  • 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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

A recent question popped up and the discussion heated up regarding updating a COMMENTS (TXT) field in a table using SSRS. http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/MS-SQL_Reporting/Q_27475269.html?cid=1572#a37227028 (htt…
A recent questions about how to add SSRS named instances, couldn't find any that talks about SQL server 2008, anyway I decided to help by creating some screen shots. The installation is straightforward, you just pop the SQL server 2008 installati…
This video discusses moving either the default database or any database to a new volume.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

746 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now