Click here to Skip to main content
12,351,441 members (35,247 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: SSRS
Hello friends,
I'm getting LastActivityDate column from the stored procedure.
when i bind that column in SSRS report it gives error, if the column has no or null value.

I tried with following
=iif((Fields!LastActivityDate.Value = ""),"",format(cdate(Fields!LastActivityDate.Value),"dd-MM-yyyy"))

but it still not working, give #error when report is run for null values.

Any idea where I'm going wrong..?

Thanks in advance =)
Posted 27-Aug-12 0:03am
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

change to:
=iif((Fields!LastActivityDate.Value = Nothing),"",format(cdate(Fields!LastActivityDate.Value),"dd-MM-yyyy"))
  Permalink  
Comments
dhage.prashant01 27-Aug-12 6:56am
   
Still its giving the same error.. :(
Kuthuparakkal 27-Aug-12 7:02am
   
Make sure LastActivityDate conforms VBA datestring format:
Conversion Result
---------- ------
CDate("May 14 1977") 14/05/1977

CDate("14/May/1977") 14/05/1977

CDate("14/05/1977") 14/05/1977

CDate("05/14/1977") 14/05/1977

CDate(0) 12:00:00 AM

CDate(-1) 29/12/1899
dhage.prashant01 28-Aug-12 2:09am
   
i have handled the same in backend, its working fine.
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

Try:
=iif((Fields!LastActivityDate.Value Is Nothing),"No-Date", FORMAT(CDate(Fields!LastActivityDate.Value),"dd-MM-yyyy"))
  Permalink  
Comments
dhage.prashant01 27-Aug-12 7:23am
   
Still same issue
if i replace some other date field in
FORMAT(CDate(Fields!LastActivityDate.Value),"dd-MM-yyyy")

It works fine, but referring same field gives error.

Any idea, y so??
Sandeep Mewara 27-Aug-12 7:49am
   
Might be your 'this' date field is not null. Check the query what is being returned for the field.
dhage.prashant01 28-Aug-12 2:09am
   
i have handled the same in backend, its working fine.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160621.1 | Last Updated 27 Aug 2012
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100