Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 New field expression with iif condition

Author  Topic 

reddymade
Posting Yak Master

165 Posts

Posted - 2006-01-16 : 11:14:21
I added a new field for calculating AGE: with an iif condition.

=Iif(isdate(fields!ContractorDate) = 1,DATEDIFF(Day, fields!ReceivedDate, fields!ContractorDate),DATEDIFF(Day, fields!ReceivedDate, GETDATE()))

I am getting the following error: when i run the reports complaining about the day as integer how should i declare:


c:\aspnet\rptStatSU.rdl The value expression for the field ‘=Iif(isdate(fields!ContractorDate) = 1,DATEDIFF(Day, fields!ReceivedDate, fields!ContractorDate),DATEDIFF(Day, fields!ReceivedDate, GETDATE()))’ contains an error: [BC30455] Argument not specified for parameter 'DateValue' of 'Public Function Day(DateValue As Date) As Integer'.

Please help, and thank you very much for the information.

AndrewMurphy
Master Smack Fu Yak Hacker

2916 Posts

Posted - 2006-01-16 : 12:00:02
IFF = ACCESS syntax
CASE = SQL syntax

please specify your installation.
Go to Top of Page
   

- Advertisement -