Showing posts with label define. Show all posts
Showing posts with label define. Show all posts

Thursday, March 22, 2012

Date Parameter without time

In the Report Parameters dialog I define my Parameter and set
Data Type to Datetime.
When I run report I get 22/2/2005 12:00:00 AM in parameter box on
top of report (parameters section of report), which is correct.
But I want to format this to appear and make input like 22/2/2005
ie.(dd/MM/yyyy) and without time part.
Thanks in advanceI use a string for all of my dates and it works fine. In my dataset or
SP that is called, I simply format the date and add 00:00:00 to the
start date, and 23:59:59 to the end date.|||Or you could use a custom code to return a short date string for that
field.
call Code.FormatDate(Fields!data.Value)
Function FormatDate(ByVal date as Object) as String
If IsDate(data) Then
Return CDate(date).ToShortDateString()
Else
Return String.Empty
End If
End Funtion

Date Parameter - run through date not to date

Is there a way in reporting services to define your date parameters as
including the final date? Right now if someone enters 08/22/2005 for the
start date and 08/29/2005 for end date it will run from 08/22/2005 12:00 AM
TO 08/29/2005 12:00 AM. This will not include results from the 29th - which
is not what the users expect.
I'd like for it to run through the date - so 08/29/2005 23:59 or 11:59 PM
Thanks for any help.
CoryIF THE START DATE PARAMETER IS NAMED SDATE AND THE END DATE PARAMETER IS
NAMED EDATE AND THE USER ENTERS EITHER AUG 30 2005 , 2005-08-30 OR 08/30/2005
YOU CAN CONVERT THE PARAMETER IN THE QUERY
SELECT *
FROM [TABLE]
WHERE CONVERT(VARCHAR(11),[DATE],101) >= CONVERT(VARCHAR(11),@.SDATE,101)
AND CONVERT(VARCHAR(11),[DATE],101) >= CONVERT(VARCHAR(11),@.EDATE,101)
THIS IS ONE OF MANY WAYS IT CAN BE DONE
P.S. SORRY FOR THE CAPS TO LAZY TO HIT THE CAPS LOCK : )
"Cory" wrote:
> Is there a way in reporting services to define your date parameters as
> including the final date? Right now if someone enters 08/22/2005 for the
> start date and 08/29/2005 for end date it will run from 08/22/2005 12:00 AM
> TO 08/29/2005 12:00 AM. This will not include results from the 29th - which
> is not what the users expect.
> I'd like for it to run through the date - so 08/29/2005 23:59 or 11:59 PM
> Thanks for any help.
> Cory|||OOPS THE >= ON THE @.EDATE SHOULD BE <= HEHE.. DUNNO HOW TO EDIT MY POST
"EsWallace" wrote:
> IF THE START DATE PARAMETER IS NAMED SDATE AND THE END DATE PARAMETER IS
> NAMED EDATE AND THE USER ENTERS EITHER AUG 30 2005 , 2005-08-30 OR 08/30/2005
> YOU CAN CONVERT THE PARAMETER IN THE QUERY
> SELECT *
> FROM [TABLE]
> WHERE CONVERT(VARCHAR(11),[DATE],101) >= CONVERT(VARCHAR(11),@.SDATE,101)
> AND CONVERT(VARCHAR(11),[DATE],101) <= CONVERT(VARCHAR(11),@.EDATE,101)
> THIS IS ONE OF MANY WAYS IT CAN BE DONE
> P.S. SORRY FOR THE CAPS TO LAZY TO HIT THE CAPS LOCK : )
> "Cory" wrote:
> > Is there a way in reporting services to define your date parameters as
> > including the final date? Right now if someone enters 08/22/2005 for the
> > start date and 08/29/2005 for end date it will run from 08/22/2005 12:00 AM
> > TO 08/29/2005 12:00 AM. This will not include results from the 29th - which
> > is not what the users expect.
> >
> > I'd like for it to run through the date - so 08/29/2005 23:59 or 11:59 PM
> >
> > Thanks for any help.
> >
> > Cory|||Thank you for your help! (I figured the less/greater than was backwards).
Thanks again.
--Cory
"EsWallace" wrote:
> OOPS THE >= ON THE @.EDATE SHOULD BE <= HEHE.. DUNNO HOW TO EDIT MY POST
> "EsWallace" wrote:
> > IF THE START DATE PARAMETER IS NAMED SDATE AND THE END DATE PARAMETER IS
> > NAMED EDATE AND THE USER ENTERS EITHER AUG 30 2005 , 2005-08-30 OR 08/30/2005
> > YOU CAN CONVERT THE PARAMETER IN THE QUERY
> >
> > SELECT *
> > FROM [TABLE]
> > WHERE CONVERT(VARCHAR(11),[DATE],101) >= CONVERT(VARCHAR(11),@.SDATE,101)
> > AND CONVERT(VARCHAR(11),[DATE],101) <= CONVERT(VARCHAR(11),@.EDATE,101)
> >
> > THIS IS ONE OF MANY WAYS IT CAN BE DONE
> >
> > P.S. SORRY FOR THE CAPS TO LAZY TO HIT THE CAPS LOCK : )
> > "Cory" wrote:
> >
> > > Is there a way in reporting services to define your date parameters as
> > > including the final date? Right now if someone enters 08/22/2005 for the
> > > start date and 08/29/2005 for end date it will run from 08/22/2005 12:00 AM
> > > TO 08/29/2005 12:00 AM. This will not include results from the 29th - which
> > > is not what the users expect.
> > >
> > > I'd like for it to run through the date - so 08/29/2005 23:59 or 11:59 PM
> > >
> > > Thanks for any help.
> > >
> > > Cory