Solved

SSRS Date formatting

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

It is helpful to note: This is a cosmetic update and is not required, but should help your reports look better for your boss.  This issue has manifested itself in SSRS version 3.0 is where I have seen this behavior in.  And this behavior is only seeā€¦
In this article I will describe the Detach & Attach method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

929 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

19 Experts available now in Live!

Get 1:1 Help Now