简体   繁体   中英

Prompt date in report with default today's date?

I am using relation SQL as a source for my query as below

select * from table where date = ?

what I need is when the user runs the report, it should prompt to date parameter. the default date should be the current date and there should be a calendar to select the date.

i am not using any universal here, so don't know what to do?

I think this is going to be as close as you can get.

select * 
from table 
where date = @Prompt('Enter Date:','D',,Mono,Free,Not_Persistent,,User:0)

在此处输入图像描述

Today's date is defaulted, but not selected. Be cautious with clicking on "Now". That will give you today's date with the current system time which is likely not what you want. You could convert your @Prompt function result to a datatype that does not include the time if you want users to be able to click "Now". In my opinion it is simple enough to instruct users to click the highlighted date for today's date.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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