Showing posts with label fieldscreateddate. Show all posts
Showing posts with label fieldscreateddate. Show all posts

Friday, March 9, 2012

format when taking two fields away from other

hi there
can someone show me how to format the following please
=(Fields!SLAResolutionDate.Value)-(Fields!CreatedDate.Value)
these are both date/time fields - I want to format to just day - two
digits and just time - two digits
so like this =Format(Fields!SLAResolutionDate.Value)-(Fields!
CreatedDate.Value), dd, hh
but I am unsure where to stop and start the brackets to get the
result.
thanks
jewelNot sure if this is the simplest, but it will work.
Try this:
'This first part finds only the "whole days". The second part determines
the "left over hours".
Format(DATEDIFF(d,
Fields!SLAResolutionDate.Value,Fields!CreatedDate.Value),"00") & " " &
Format(DATEDIFF(d, Fields!SLAResolutionDate.Value,Fields!CreatedDate.Value) *
24 - DATEDIFF(hh,
Fields!SLAResolutionDate.Value,Fields!CreatedDate.Value),"00")
Michael
"jewelfire" wrote:
> hi there
> can someone show me how to format the following please
> =(Fields!SLAResolutionDate.Value)-(Fields!CreatedDate.Value)
> these are both date/time fields - I want to format to just day - two
> digits and just time - two digits
>
> so like this =Format(Fields!SLAResolutionDate.Value)-(Fields!
> CreatedDate.Value), dd, hh
> but I am unsure where to stop and start the brackets to get the
> result.
> thanks
> jewel
>|||Correction: the second part should be reversed (hours - days*24):
Format(DATEDIFF(d,
Fields!SLAResolutionDate.Value,Fields!CreatedDate.Value),"00") & " " &
Format(DATEDIFF(hh,
Fields!SLAResolutionDate.Value,Fields!CreatedDate.Value)-
DATEDIFF(d, Fields!SLAResolutionDate.Value,Fields!CreatedDate.Value) *
24,"00")
"Michael C" wrote:
> Not sure if this is the simplest, but it will work.
> Try this:
> 'This first part finds only the "whole days". The second part determines
> the "left over hours".
> Format(DATEDIFF(d,
> Fields!SLAResolutionDate.Value,Fields!CreatedDate.Value),"00") & " " &
> Format(DATEDIFF(d, Fields!SLAResolutionDate.Value,Fields!CreatedDate.Value) *
> 24 - DATEDIFF(hh,
> Fields!SLAResolutionDate.Value,Fields!CreatedDate.Value),"00")
> Michael
> "jewelfire" wrote:
> > hi there
> >
> > can someone show me how to format the following please
> >
> > =(Fields!SLAResolutionDate.Value)-(Fields!CreatedDate.Value)
> >
> > these are both date/time fields - I want to format to just day - two
> > digits and just time - two digits
> >
> >
> >
> > so like this =Format(Fields!SLAResolutionDate.Value)-(Fields!
> > CreatedDate.Value), dd, hh
> >
> > but I am unsure where to stop and start the brackets to get the
> > result.
> >
> > thanks
> > jewel
> >
> >|||thanks Michael
I get the error 'd' is not declared.
I am putting this in the expression on the layout view.
thanks
jewel
On May 9, 4:29 am, Michael C <Micha...@.discussions.microsoft.com>
wrote:
> Correction: the second part should be reversed (hours - days*24):
> Format(DATEDIFF(d,
> Fields!SLAResolutionDate.Value,Fields!CreatedDate.Value),"00") & " " &
> Format(DATEDIFF(hh,
> Fields!SLAResolutionDate.Value,Fields!CreatedDate.Value)-
> DATEDIFF(d, Fields!SLAResolutionDate.Value,Fields!CreatedDate.Value) *
> 24,"00")
>
> "Michael C" wrote:
> > Not sure if this is the simplest, but it will work.
> > Try this:
> > 'This first part finds only the "whole days". The second part determines
> > the "left over hours".
> > Format(DATEDIFF(d,
> > Fields!SLAResolutionDate.Value,Fields!CreatedDate.Value),"00") & " " &
> > Format(DATEDIFF(d, Fields!SLAResolutionDate.Value,Fields!CreatedDate.Value) *
> > 24 - DATEDIFF(hh,
> > Fields!SLAResolutionDate.Value,Fields!CreatedDate.Value),"00")
> > Michael
> > "jewelfire" wrote:
> > > hi there
> > > can someone show me how to format the following please
> > > =(Fields!SLAResolutionDate.Value)-(Fields!CreatedDate.Value)
> > > these are both date/time fields - I want to format to just day - two
> > > digits and just time - two digits
> > > so like this =Format(Fields!SLAResolutionDate.Value)-(Fields!
> > > CreatedDate.Value), dd, hh
> > > but I am unsure where to stop and start the brackets to get the
> > > result.
> > > thanks
> > > jewel- Hide quoted text -
> - Show quoted text -|||Try using dd instead of just d, and be sure there are no quotes around it.
Here is the MSDN file for valid entries!
http://msdn2.microsoft.com/en-us/library/ms189794.aspx
"jewelfire" wrote:
> thanks Michael
> I get the error 'd' is not declared.
> I am putting this in the expression on the layout view.
> thanks
> jewel
>
> On May 9, 4:29 am, Michael C <Micha...@.discussions.microsoft.com>
> wrote:
> > Correction: the second part should be reversed (hours - days*24):
> >
> > Format(DATEDIFF(d,
> > Fields!SLAResolutionDate.Value,Fields!CreatedDate.Value),"00") & " " &
> > Format(DATEDIFF(hh,
> > Fields!SLAResolutionDate.Value,Fields!CreatedDate.Value)-
> > DATEDIFF(d, Fields!SLAResolutionDate.Value,Fields!CreatedDate.Value) *
> > 24,"00")
> >
> >
> >
> > "Michael C" wrote:
> > > Not sure if this is the simplest, but it will work.
> >
> > > Try this:
> > > 'This first part finds only the "whole days". The second part determines
> > > the "left over hours".
> >
> > > Format(DATEDIFF(d,
> > > Fields!SLAResolutionDate.Value,Fields!CreatedDate.Value),"00") & " " &
> > > Format(DATEDIFF(d, Fields!SLAResolutionDate.Value,Fields!CreatedDate.Value) *
> > > 24 - DATEDIFF(hh,
> > > Fields!SLAResolutionDate.Value,Fields!CreatedDate.Value),"00")
> >
> > > Michael
> >
> > > "jewelfire" wrote:
> >
> > > > hi there
> >
> > > > can someone show me how to format the following please
> >
> > > > =(Fields!SLAResolutionDate.Value)-(Fields!CreatedDate.Value)
> >
> > > > these are both date/time fields - I want to format to just day - two
> > > > digits and just time - two digits
> >
> > > > so like this =Format(Fields!SLAResolutionDate.Value)-(Fields!
> > > > CreatedDate.Value), dd, hh
> >
> > > > but I am unsure where to stop and start the brackets to get the
> > > > result.
> >
> > > > thanks
> > > > jewel- Hide quoted text -
> >
> > - Show quoted text -
>
>|||hi Michael
tried as below
=Format(DATEDIFF(dd,Fields!SLAResolutionDate.Value,Fields!
CreatedDate.Value),"00") & " " &
Format(DATEDIFF(hh,Fields!SLAResolutionDate.Value,Fields!
CreatedDate.Value)-
DATEDIFF(dd, Fields!SLAResolutionDate.Value,Fields!CreatedDate.Value)
*
24,"00")
dd - this is underlined and in red but the 2nd instance is not.
showing red on
"00") & " " &
"00")
probably something very simple! thanks for your help
thanks
jewel
On May 10, 4:24 am, Michael C <Micha...@.discussions.microsoft.com>
wrote:
> Try using dd instead of just d, and be sure there are no quotes around it.
> Here is the MSDN file for valid entries!
> http://msdn2.microsoft.com/en-us/library/ms189794.aspx
>
> "jewelfire" wrote:
> > thanks Michael
> > I get the error 'd' is not declared.
> > I am putting this in the expression on the layout view.
> > thanks
> > jewel
> > On May 9, 4:29 am, Michael C <Micha...@.discussions.microsoft.com>
> > wrote:
> > > Correction: the second part should be reversed (hours - days*24):
> > > Format(DATEDIFF(d,
> > > Fields!SLAResolutionDate.Value,Fields!CreatedDate.Value),"00") & " " &
> > > Format(DATEDIFF(hh,
> > > Fields!SLAResolutionDate.Value,Fields!CreatedDate.Value)-
> > > DATEDIFF(d, Fields!SLAResolutionDate.Value,Fields!CreatedDate.Value) *
> > > 24,"00")
> > > "Michael C" wrote:
> > > > Not sure if this is the simplest, but it will work.
> > > > Try this:
> > > > 'This first part finds only the "whole days". The second part determines
> > > > the "left over hours".
> > > > Format(DATEDIFF(d,
> > > > Fields!SLAResolutionDate.Value,Fields!CreatedDate.Value),"00") & " " &
> > > > Format(DATEDIFF(d, Fields!SLAResolutionDate.Value,Fields!CreatedDate.Value) *
> > > > 24 - DATEDIFF(hh,
> > > > Fields!SLAResolutionDate.Value,Fields!CreatedDate.Value),"00")
> > > > Michael
> > > > "jewelfire" wrote:
> > > > > hi there
> > > > > can someone show me how to format the following please
> > > > > =(Fields!SLAResolutionDate.Value)-(Fields!CreatedDate.Value)
> > > > > these are both date/time fields - I want to format to just day - two
> > > > > digits and just time - two digits
> > > > > so like this =Format(Fields!SLAResolutionDate.Value)-(Fields!
> > > > > CreatedDate.Value), dd, hh
> > > > > but I am unsure where to stop and start the brackets to get the
> > > > > result.
> > > > > thanks
> > > > > jewel- Hide quoted text -
> > > - Show quoted text -- Hide quoted text -
> - Show quoted text -