Solved

SSRS Date formatting

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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
sql query 8 48
Is there any way to convert exponential value to number in sql server 5 38
get column names from table in vb.net 8 26
TSQL - How to declare table name 26 29
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…
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

786 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