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
Solved

SSRS Date formatting

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

How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

Question has a verified solution.

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

Hi all, It is important and often overlooked to understand “Database properties”. Often we see questions about "log files" or "where is the database" and one of the easiest ways to get general information about your database is to use “Database p…
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…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

790 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