Date based Parameters - Reporting Services 2008
I'm tearing my hair out on this... I want to select records from an Oracle database based on the date they were created - I've got 2 parameters INSDATE and INFDATE and the SQL I'm using in the query behind the report is WHERE TO_DATE(C_DATE,'DD/MM/RRRR') BETWEEN TO_DATE(@INSDATE,'DD/MM/RRRR') AND TO_DATE(@INFDATE,'DD/MM/RRRR') But it just doesn't work - get error ORA-00936 Missing expression Without the parameters report works fine (picking up all records created in the current month). Report language is set to En-GB Can anyone offer a solution before I'm completely bald? ;)
July 4th, 2011 11:48am

Based on the list of parameters at: http://www.techonthenet.com/oracle/functions/to_date.php, you need 'DD/MM/RRRR'.If this post, or another, answers your question, please click the 'Mark as answer' button so others with the same problem can find a solution more easily.
Free Windows Admin Tool Kit Click here and download it now
July 4th, 2011 11:55am

I'd tried various variations around that - but no joy I've tried separating out the day, month and year and doing the comparison separately - no better, still errors out. Thanks for the reponse though C
July 5th, 2011 4:14am

hey wobbleu8, try using this for oracle, WHERE TO_DATE(C_DATE,'DD/MM/RRRR') BETWEEN TO_DATE(:INSDATE,'DD/MM/RRRR') AND TO_DATE(:INFDATE,'DD/MM/RRRR') Note: @ wont work while fetching data from oracle, you need to change it with : Regards Manoj
Free Windows Admin Tool Kit Click here and download it now
July 5th, 2011 4:42am

Sorry for tardy response When I put the : in place of @ and click to run the code in query designer I don't get prompted for parameter values and then get an error ORA-01008 not all variables bound. thanks Chris
July 10th, 2011 11:44am

Yippee! Got it to work Changed the criteria to WHERE AND C_DATE >= :INSDATE AND C_DATE <= :INFDATE and then in dataset properties and the parameter tab added my two parameters with this expression in Parameter Value =DateValue(Parameters!INSDATE.Value) =DateValue(Parameters!INFDATE.Value) Thanks for your help guys....
Free Windows Admin Tool Kit Click here and download it now
July 10th, 2011 12:02pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics