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
 General SQL Server Forums
 New to SQL Server Programming
 Help with Date Parameter in SSRS

Author  Topic 

jsapp
Starting Member

3 Posts

Posted - 2014-10-28 : 09:19:11
Hi guys,

I need a little help with a date parameter. Below is my dataset query. I have highlighted in red the date section. I am having diffculty coming up with a way to get the date range wording correct so that I can create paramenters in the report where the user can select a startdate and a enddate from the parameter drop down list.

SELECT rp.prop_cd, rp.prop_name, ea.prop_key, missingaccts.acct_key, ea.acct_cd, epl.provider_key, ep.provider_cd, ep.provider_name
FROM

(SELECT rbmsaccts.acct_key
FROM
(select distinct eb.acct_key from em_bill eb
where eb.PROP_KEY IN
(select p.prop_key from rbms_company c, rbms_property p
where c.company_cd = :Ccode
and p.company_key = c.company_key)
and trunc(eb.create_time) BETWEEN to_date('8/1/2014', 'mm/dd/yyyy') AND to_date('8/31/2014', 'mm/dd/yyyy') rbmsaccts

LEFT JOIN (SELECT *
FROM AUMUSER.RS_URT_ACCOUNT
WHERE PROP_KEY IN
(select p.prop_key from rbms_company c, rbms_property p
where c.company_cd = :Ccode
and p.company_key = c.company_key)) pureaccts
ON rbmsaccts.acct_key = pureaccts.acct_key
WHERE pureaccts.acct_key IS NULL) missingaccts

left join em_acct ea on ea.acct_key = missingaccts.acct_key
left join em_provider_line epl on epl.provider_line_key = ea.provider_line_key
left join em_provider ep on ep.provider_key = epl.provider_key
left join rbms_property rp on rp.prop_key = ea.prop_key
order by rp.prop_cd


Thanks in advance

gbritton
Master Smack Fu Yak Hacker

2780 Posts

Posted - 2014-10-28 : 09:37:34
What database are you using? Your query is not a valid SQL Server query. e.g. there is no trunc function or to_date function in SQL Server, and ":Ccode" is not valid either.
Go to Top of Page

jsapp
Starting Member

3 Posts

Posted - 2014-10-28 : 09:42:31
quote:
Originally posted by gbritton

What database are you using? Your query is not a valid SQL Server query. e.g. there is no trunc function or to_date function in SQL Server, and ":Ccode" is not valid either.



The query is from Oracle DB and :Ccode is actually denotes a parameter for SSRS.
Go to Top of Page

gbritton
Master Smack Fu Yak Hacker

2780 Posts

Posted - 2014-10-28 : 09:53:20
You might want to post this in an Oracle forum.
Go to Top of Page
   

- Advertisement -