Advertisement

05.07.2008 at 04:32PM PDT, ID: 23384629
[x]
Attachment Details

How do I fix the code on my parameters?

Asked by RhondaCarroll in SQL Server 2005, SQL Query Syntax

Tags: , ,

Hi,

I have a report that has 3 parameters: sdate, edate and status but I am getting syntax errors and I'm not sure how to setup status properly. The query has a field called open date as you can see from the query and this is what I need to use with my sdate and edate parameters. I need my status paramter to have a drop down consisting of All, Open and Closed. I have the paramters created including the status parameter with the drop down values. How can I code the query to choose just records with an open status, closed or all? Please see code.

Thanks
RcStart Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
select  _SMDBA_._SEVERITY_.name as [PRIORITY],_SMDBA_._TELMASTE_.sequence as [Incident], 
 _SMDBA_._udstatus_.ID as [Status],_SMDBA_._CUSTOMER_.client as [Requested By],
 _SMDBA_._PERSONNEL_.code as [ASSIGNED TO], _SMDBA_._GROUPS_.code as [Group],
_SMDBA_._SUBJECTS_.description as [Category Description], 
[date open], [closed on],synopsis,_SMDBA_._TELMASTE_.description as [Incident Description],
 resolution
from _SMDBA_._TELMASTE_ , _SMDBA_._GROUPS_, _SMDBA_._CUSTOMER_, _SMDBA_._PERSONNEL_, _SMDBA_._SUBJECTS_,
_SMDBA_._SEVERITY_, _SMDBA_._UDSTATUS_
where _SMDBA_._TELMASTE_._group_ *= _SMDBA_._GROUPS_.sequence and
_SMDBA_._TELMASTE_.client *= _SMDBA_._CUSTOMER_.sequence and 
_SMDBA_._TELMASTE_.[sent to] *= _SMDBA_._PERSONNEL_.sequence and 
_SMDBA_._TELMASTE_.subject *= _SMDBA_._SUBJECTS_.sequence and 
_SMDBA_._TELMASTE_.[seq_Severity:] *= _SMDBA_._SEVERITY_.sequence and 
_SMDBA_._TELMASTE_.[seq_udstatus:]*= _SMDBA_._UDSTATUS_.sequence 
and _SMDBA_._TELMASTE_.[seq_udstatus:] <> 1004
and _SMDBA_._telmaste_.client = 1638
--And  [date open] >= to_date(:sdate,'YYYY-MM-DD') and [date open] <= --to_date(:edate,'YYYY-MM-DD')+1 
And _SMDBA_._udstatus_.ID in (:Status)
order by status desc
 
Loading Advertisement...
 
[+][-]05.07.2008 at 04:52PM PDT, ID: 21521330

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.07.2008 at 05:07PM PDT, ID: 21521378

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: SQL Server 2005, SQL Query Syntax
Tags: Microsoft, Reporting Services, Microsoft SQL Server Report Designer Version 8.00.743.00
Sign Up Now!
Solution Provided By: Wikkard
Participating Experts: 2
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628