SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


New to SSRS help ! write expression according to condition


New to SSRS help ! write expression according to condition

Author
Message
SHR
SHR
Grasshopper
Grasshopper (14 reputation)Grasshopper (14 reputation)Grasshopper (14 reputation)Grasshopper (14 reputation)Grasshopper (14 reputation)Grasshopper (14 reputation)Grasshopper (14 reputation)Grasshopper (14 reputation)

Group: General Forum Members
Points: 14 Visits: 65
hey guys i am very new to SSRS 2008,
I have to design one expresion for one text box which will give count of some fields.
ex. want to count total number tickets with status P or T or C for yesterday.
As we cant use where clause while writting expession here , i nt been able to write the expression

want working expression for following condition

count(fields!tickets.value = "P" or "C") where ticket_date <>today()

it should give the count of tickets for the date not equal to today

Your timely help will be appreciated

Regards,
Shekhar
Rajesh Jonnalagadda
Rajesh Jonnalagadda
SSChasing Mays
SSChasing Mays (640 reputation)SSChasing Mays (640 reputation)SSChasing Mays (640 reputation)SSChasing Mays (640 reputation)SSChasing Mays (640 reputation)SSChasing Mays (640 reputation)SSChasing Mays (640 reputation)SSChasing Mays (640 reputation)

Group: General Forum Members
Points: 640 Visits: 279
Hi,

Try this

=SUM(IIF(Fields!tickets.value = "P" or Fields!tickets.value = "C" and Fields!ticket_date.Value = today()-1, 1, 0))
bzabel
bzabel
Grasshopper
Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)Grasshopper (22 reputation)

Group: General Forum Members
Points: 22 Visits: 31
In plain english what does "today()-1, 1, 0" mean in the example code you posted?
chanluongbus
chanluongbus
Grasshopper
Grasshopper (24 reputation)Grasshopper (24 reputation)Grasshopper (24 reputation)Grasshopper (24 reputation)Grasshopper (24 reputation)Grasshopper (24 reputation)Grasshopper (24 reputation)Grasshopper (24 reputation)

Group: General Forum Members
Points: 24 Visits: 3
=SUM(IIF(Fields!tickets.value = "P" or Fields!tickets.value = "C" and Fields!ticket_date.Value = today()-1, 1, 0))

today()-1 is today date - 1, 1 is the condition for the iffstatatemet, and 0 is when it fault.
http://ssrsdeveloper.blogspot.com/2011/01/new-to-ssrs-what-you-need.html
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search