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.
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_keyFROM(select distinct eb.acct_key from em_bill ebwhere eb.PROP_KEY IN (select p.prop_key from rbms_company c, rbms_property pwhere c.company_cd = :Ccodeand 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') rbmsacctsLEFT JOIN (SELECT *FROM AUMUSER.RS_URT_ACCOUNT WHERE PROP_KEY IN (select p.prop_key from rbms_company c, rbms_property pwhere c.company_cd = :Ccodeand p.company_key = c.company_key)) pureacctsON rbmsaccts.acct_key = pureaccts.acct_keyWHERE pureaccts.acct_key IS NULL) missingacctsleft join em_acct ea on ea.acct_key = missingaccts.acct_keyleft join em_provider_line epl on epl.provider_line_key = ea.provider_line_keyleft join em_provider ep on ep.provider_key = epl.provider_keyleft join rbms_property rp on rp.prop_key = ea.prop_keyorder by rp.prop_cdThanks 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. |
|
|
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. |
|
|
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. |
|
|
|
|
|
|
|