简体   繁体   English

SSRS 日期/时间参数

[英]SSRS date/time parameter

I have a ssrs report that has a date/time parameter that allows the user to select the date when running report.我有一个 ssrs 报告,它有一个日期/时间参数,允许用户在运行报告时选择日期。 how to I get it to exclude the time part of the date field.如何让它排除日期字段的时间部分。

currently the field in the db is a date/time field so when I run query当前数据库中的字段是日期/时间字段,所以当我运行查询时

select count(*) from table where date <= @dateparameter 

it is not including records where the time part of field is greater than 00.00.00它不包括字段时间部分大于 00.00.00 的记录

how can I ignore the time part so all records are returned for that date如何忽略时间部分,以便返回该日期的所有记录

最简单(也可能是最佳性能)的解决方案是在用户传递的日期中添加一天并将<=更改为<

select count(*) from table where date < DATEADD(DAY, 1, @dateparameter)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM