﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / Reporting Services / Reporting Services 2005 Development  / Parameter Startdate, Enddate validation / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Tue, 21 May 2013 15:49:38 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Parameter Startdate, Enddate validation</title><link>http://www.sqlservercentral.com/Forums/Topic1016823-1063-1.aspx</link><description>Hi that is an alternative.I have tried using the code itself , it is working but still Im not satisfied... :-) the code is below. As you told  I have used a hidden parameter then from there I called the function.But problem is because of the Err.Raise(6,Report)  the return value is not a string type so that the parameter is not getting the value, ie the validation of the hidden paramter is not satisfied and so the [b]report wont run[/b] this is what we need.But the problem is it will show a message as the validation failed for the parameter... :-( Can any experts help on this...?[code="plain"]Public Function MyFunction(S as Datetime,E as Datetime) as StringDim msg as stringmsg=""if(S&amp;gt;E) then	msg = "Start Date Should not be greater than End Date"end ifIf msg &amp;lt;&amp;gt; "" Then MsgBox(msg, 16, "Report Validation")Err.Raise(6,Report) 'Raise an overflowend ifReturn msg End Function[/code]You can see this if you call the function from a text box rather than the hidden parameter, but there the report will run even though it is checking the Start date and End Date...</description><pubDate>Mon, 08 Nov 2010 19:17:47 GMT</pubDate><dc:creator>only4mithunc</dc:creator></item><item><title>RE: Parameter Startdate, Enddate validation</title><link>http://www.sqlservercentral.com/Forums/Topic1016823-1063-1.aspx</link><description>Make the available values for your @EndDate based on a query that constrains the dates to &amp;gt; @StartDate</description><pubDate>Mon, 08 Nov 2010 13:00:46 GMT</pubDate><dc:creator>Daniel Bowlin</dc:creator></item><item><title>Parameter Startdate, Enddate validation</title><link>http://www.sqlservercentral.com/Forums/Topic1016823-1063-1.aspx</link><description>Hi all,I'm working on a ssrs report with parameters startdate and enddate@startdate : default to 1st of previous month@enddate  :  default to last day of previous monthUser can change the startdate,enddateNow when user select case 1) @startdate &amp;lt; @enddate ( ex: startdate: 10/1/2010, enddate: 10/11/2010 this is fine )case 2) @startdate &amp;gt; @enddate (ex: startdate: 10/31/2010, enddate: 10/1/2010  this should not happened)The user should not be able to select values as in case2or If he select as in case2, then we should prompt/warn the user (msg -"startdate should not later than enddate") [u]I tried the following solution:[/u]report-&amp;gt;report properties-&amp;gt;codestep1)Function CheckDateParameters(@StartDate as Datetime, @EndDate as Datetime) as IntegerDim msg as Stringmsg = ""If (@StartDate &amp;gt; @EndDate) Thenmsg="Start Date should not be later than End Date"End IfIf msg &amp;lt;&amp;gt; "" Then MsgBox(msg, 16, "Report Validation")Err.Raise(6,Report) 'Raise an overflowEnd IfEnd Functionstep2) created a hidden parameter "@validate" and set its default to=CODE.CheckDateParameters(@StartDate.Value,@EndDate.Value)It worked in BIDS (My system) but failed on QAPlease help me in solving this issue Thanks in advance:)-pravin</description><pubDate>Fri, 05 Nov 2010 16:22:36 GMT</pubDate><dc:creator>sql.pravin</dc:creator></item></channel></rss>