x

Using an Input mask in Report Builder 3.0

My apologies if this is an obvious question, I've spent the past 3 hours googling for an answer without success. How do I force an end user to enter a specific date time format into a parameter? Obviously, I want to indicate to the user the format I'm requesting. Any help would be appreciated. Thanks.
more ▼

asked Jul 15 '13 at 08:02 PM in Default

Newreportbuilder gravatar image

Newreportbuilder
30 1 1 1

(comments are locked)
10|1200 characters needed characters left

2 answers: sort voted first

You can try to split the date and create 3 Textboxes: Year, Month, Day.

Wouldn't it be easier?
more ▼

answered Jul 16 '13 at 08:52 AM

eghetto gravatar image

eghetto
2.1k 15 17 21

(comments are locked)
10|1200 characters needed characters left

If you do not need a default value for the parameter, than you can put the mast ask default value for that parameter and set the parameter type to Text. (The desired format style will be the default value).

Than you create an Internal parameter of type DateTime, which do not allows NULL Value. As default value you will process the value entered in the previous one. (you can Write your custom Code to parse the value to DateTime based on requested format. If it will not match the custom format, it will return NULL.

As the second parameter is set not to accept NULL, report will not be rendered until a proper date in desired format will be entered as the original param.

or Simply as @eghetto mentiond, split it into three params Year, Month, day.
more ▼

answered Jul 16 '13 at 01:02 PM

Pavel Pawlowski gravatar image

Pavel Pawlowski
22.2k 8 11 21

(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

New code box

There's a new way to format code on the site - the red speech bubble logo will automatically format T-SQL for you. The original code box is still there for XML, etc. More details here.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.

Topics:

x536

asked: Jul 15 '13 at 08:02 PM

Seen: 552 times

Last Updated: Jul 16 '13 at 01:02 PM