Thursday, March 22, 2012

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

No comments:

Post a Comment