Showing posts with label valid. Show all posts
Showing posts with label valid. Show all posts

Wednesday, March 7, 2012

Operator is not valid for type 'Date' and type 'Date'

I was wondering if someone could assist me in writing an experession that
would subtract 2 DateTime's. I have 2 DateTime fields and want to display
both in a report and in a third column the difference between the 2 values.
However, I get an error:
"Operator is not valid for type 'Date' and type 'Date'"
Many thanks,
SimonYou can get the difference from SQL by trying something like this in your
store proc or query
SELECT date1, date2, DATEDIFF(d, date1, date2) AS date3
hope it helps.
- David
"Simon Dingley" wrote:
> I was wondering if someone could assist me in writing an experession that
> would subtract 2 DateTime's. I have 2 DateTime fields and want to display
> both in a report and in a third column the difference between the 2 values.
> However, I get an error:
> "Operator is not valid for type 'Date' and type 'Date'"
> Many thanks,
> Simon
>
>|||Assuming you have two DateTime fields and you want to determine the
difference in total seconds in the report rather than the query, you can use
an expression like this:
=Datediff("s", Fields!End_Time.Value, Fields!Start_Time.Value)
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"David Nevarez" <DavidNevarez@.discussions.microsoft.com> wrote in message
news:33B5D244-F9D5-4ECB-99CB-F9B1B7D9E445@.microsoft.com...
> You can get the difference from SQL by trying something like this in your
> store proc or query
> SELECT date1, date2, DATEDIFF(d, date1, date2) AS date3
> hope it helps.
> - David
> "Simon Dingley" wrote:
> > I was wondering if someone could assist me in writing an experession
that
> > would subtract 2 DateTime's. I have 2 DateTime fields and want to
display
> > both in a report and in a third column the difference between the 2
values.
> > However, I get an error:
> >
> > "Operator is not valid for type 'Date' and type 'Date'"
> >
> > Many thanks,
> >
> > Simon
> >
> >
> >|||Thank You for the replies. I opted for the in-report solution as opposed to
the SQL solution but thanks for both. What I want to return is the
difference in days and hours but can seem to do it I changed the format
string to "d" instead of "s" to return the number of days but when I tried
to use "d h" i get "#error".
Thanks for the help.
Simon
"Robert Bruckner [MSFT]" <robruc@.online.microsoft.com> wrote in message
news:eVK4OnNsEHA.832@.TK2MSFTNGP10.phx.gbl...
> Assuming you have two DateTime fields and you want to determine the
> difference in total seconds in the report rather than the query, you can
use
> an expression like this:
> =Datediff("s", Fields!End_Time.Value, Fields!Start_Time.Value)
> --
> This posting is provided "AS IS" with no warranties, and confers no
rights.

Operation is not valid due to the current state of the object

Hello,

We are getting this error when a user clients any report. they can see the directories OK, but when we upload a new report the error still happens.

Error is "Operation is not valid due to the current state of the object."

Any ideas?

Thanks

Michael

Hi Michael,

I am also getting the same error whenever I tried to open a report through browser. Please let me know if you have resolved this issue and the fix for the same.

Thanks & Regards,

Sathya

|||

This was address in a previous forum by Brian Hartman, I have provided you with a link:

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=212322&SiteID=1

Ham

Operation is not valid due to the current state of the object

Hello,

We are getting this error when a user clients any report. they can see the directories OK, but when we upload a new report the error still happens.

Error is "Operation is not valid due to the current state of the object."

Any ideas?

Thanks

Michael

Hi Michael,

I am also getting the same error whenever I tried to open a report through browser. Please let me know if you have resolved this issue and the fix for the same.

Thanks & Regards,

Sathya

|||

This was address in a previous forum by Brian Hartman, I have provided you with a link:

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=212322&SiteID=1

Ham

Operation is not valid due to the current state of the object

One of our developers intermittently gets this error "Operation is not valid
due to the current state of the object" when exporting a report to Excel from
Preview in Designer. It seems to happen when he attempts to export a second
time after changing a parameter value in Preview. Any thoughts?I'm getting the same error, only it doesn't happen in Report Designer, only
when viewing it on the web using the ReportServer. Very strange... And only
with certain parameters.
"toolman_2000" wrote:
> One of our developers intermittently gets this error "Operation is not valid
> due to the current state of the object" when exporting a report to Excel from
> Preview in Designer. It seems to happen when he attempts to export a second
> time after changing a parameter value in Preview. Any thoughts?