I have a report that runs daily.
I need to set the criteria for a date field to be today.
if i use the now() command then i get the value to the minute, whereas i wan
to cover the entire day.
today() doen't work in reporting services with visul studio.
what other date command can i use?This will give you the date with no time portion.
Now.ToShortDateString
Note that for a date/time field this really turns out to be today at 12 AM.
This would convert it back to a date instead of text.
CDate(Now.ToShortDateString)
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"anon" <anon@.anon.com> wrote in message
news:%23Bz8zTC8FHA.2816@.tk2msftngp13.phx.gbl...
>I have a report that runs daily.
> I need to set the criteria for a date field to be today.
> if i use the now() command then i get the value to the minute, whereas i
> wan to cover the entire day.
> today() doen't work in reporting services with visul studio.
> what other date command can i use?
>
>|||How would i enter this into the criteria part of the query?
"Bruce L-C [MVP]" <bruce_lcNOSPAM@.hotmail.com> wrote in message
news:%23bxuGQD8FHA.1020@.TK2MSFTNGP15.phx.gbl...
> This will give you the date with no time portion.
> Now.ToShortDateString
> Note that for a date/time field this really turns out to be today at 12
> AM.
> This would convert it back to a date instead of text.
> CDate(Now.ToShortDateString)
>
> --
> Bruce Loehle-Conger
> MVP SQL Server Reporting Services
> "anon" <anon@.anon.com> wrote in message
> news:%23Bz8zTC8FHA.2816@.tk2msftngp13.phx.gbl...
>>I have a report that runs daily.
>> I need to set the criteria for a date field to be today.
>> if i use the now() command then i get the value to the minute, whereas i
>> wan to cover the entire day.
>> today() doen't work in reporting services with visul studio.
>> what other date command can i use?
>>
>|||If this is the default for the report parameter then just use this for the
default.
If you haven't yet done any queries that are parameter based then backup and
do some simple reports that use query parameters like this:
select * from sometable where somevalue = @.MyParam
Note that if this is hard coded, the report should only do the current day
then use SQL syntax. You don't even need a query parameter. I am at home and
don't have my SQL reference but I am sure there is some normal SQL that can
be used (like DatePart, DateAdd etc).
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"anon" <anon@.anon.com> wrote in message
news:%23Y0u5KP8FHA.3636@.TK2MSFTNGP09.phx.gbl...
> How would i enter this into the criteria part of the query?
>
> "Bruce L-C [MVP]" <bruce_lcNOSPAM@.hotmail.com> wrote in message
> news:%23bxuGQD8FHA.1020@.TK2MSFTNGP15.phx.gbl...
>> This will give you the date with no time portion.
>> Now.ToShortDateString
>> Note that for a date/time field this really turns out to be today at 12
>> AM.
>> This would convert it back to a date instead of text.
>> CDate(Now.ToShortDateString)
>>
>> --
>> Bruce Loehle-Conger
>> MVP SQL Server Reporting Services
>> "anon" <anon@.anon.com> wrote in message
>> news:%23Bz8zTC8FHA.2816@.tk2msftngp13.phx.gbl...
>>I have a report that runs daily.
>> I need to set the criteria for a date field to be today.
>> if i use the now() command then i get the value to the minute, whereas i
>> wan to cover the entire day.
>> today() doen't work in reporting services with visul studio.
>> what other date command can i use?
>>
>>
>
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment