Web Intelligence : input control calendar and empty var - business-objects

I know how to create an empty text var in webi depending input control (using ="" formula). I tried to apply this for dates but I can't select calendar control.
How can I create an empty date var linked to a calendar input control ?
Update :
First I create the date type var
Then I create the input control. I don't have the same interface maybe because of the french version or the support pack difference ?
Finally I update my var

This is certainly not intuitive, but I think this will work for you.
Begin by creating a variable with a value or formula that is a date data type. I called my variable Input Control Date.
=CurrentDate()
This would also work.
=ToDate("06/03/2020"; "MM/dd/yyyy")
We will change this later. The reason for this is so that WebI will give you the option of creating an input control with a calendar date picker.
Create your input control based on Input Control Date.
I think you would want to set the Dependencies to "Whole Document", but you may want to change that based on your specific situation.
Now that you have created your input control with the calendar control to choose the date you can go back and change the value of Input Control Date to an empty string.
=""
If you want to be able to format your chosen date value (or compare it to an object with a date data type) you will need to create another variable and convert it to a date since Input Control Date is not a string and cannot be formatted. That would look like this.
=ToDate([Input Control Date]; "MM/dd/yyyy")
And now a format can be applied.

Related

Date time parameter in SSRS

I have a report which requires user to type the start date and also allow them to choose from calendar. I was wondering if its possible to enter the date as a string. Right now, I have a text field with calendar and I would like the user to enter date[06302015] instead of [06/30/2015]
can we omit the dashes and still have the report format it to date?
The type of a parameter can be changed from Parameter Properties like below.
This will remove the Calendar and it will be only a Text box.
Change your parameter type to "Text".
Add a second "Hidden" parameter (as Date/Time data Type) that takes the LAST_DATE_EDITED as an input into the 2nd parameter's default value using the expression: =DateValue(Mid(Parameters!LAST_DATE_EDITED.Value,1,2) & "/" & Mid(Parameters!LAST_DATE_EDITED.Value,3,2) & "/" & Mid(Parameters!LAST_DATE_EDITED.Value,5,4))
(Not tested, but it should be close)
Then use the 2nd parameter in your report instead of LAST_DATE_EDITED.
If the user inputs an incorrectly formatted string of numbers, uses text, etc., SSRS will throw an exception.
IMO, this isn't the most elegant solution and it demands user input that is prone to errors. Not what I would implement (I would have the users use the built in DateTime picker and train them to use valid separators such as periods, slashes or dashes or just use the calendar control).

Changing the date format in Access 2010

I want to show the Purchase_Date in dd/mm/yy format . I already set the Format in form properties as dd/mm/yy
When i select a cell in database view it shows the date in dd/mm/yy but it still shows the date in mm/dd/yy otherwise
I need 05/02/14 to show as 02/05/14 at all times
This is by design. When the control gets focus, it will revert to the default format as to the settings in Windows.
A workaround can be to use three concatenated textboxes, but it requires some code to operate nicely.
You have to go to the Region and Language in the Control Panel and choose "English (Autralia)" as the format in the formats tab. Then change the short date format from the option below as you require. The format you want is available there.
Edit:
A better way to do it is to apply your own format. In the Format property of the properties of the Date/Time field, you can type in the format you want using placeholders and separators.
Hope this solves your problem.

MSAccess Change Date Value Before Validation

In a grid I have a date/time field where I would like the user to be able to type in short-hand formats for dates and times. For example, if they type in "435p" and then focus off of the cell they get the message "The value you entered isn't valid for this field.". Instead, I want to trap a pre-validationevent and change it to "4:35pm" for them.
What event can I use?
I've tried:
LostFocus & BeforeUpdate: too late (validation fires before event)
Dirty & OnChange: too early (they haven't left the cell yet)
Or is there a way to turn off the native validation rule that is checking for date formats?
You could use an additional text field without formatting (or with your very own format). Then show this instead of the datetime-field and update the date-time field with your code.
Not very pretty, but if you always format the input to a proper time string on before-update and never access this field (but rather the real date-time field) you should be ok. You could even name the field Helper_DateTime or somesuch, so you are never tempted to access the field from anywhere else ;)

Can I create Date entry control with date separator for classic ASP

I was using a calendar control for entry of date in a classic-ASP application. But calendar control is not keyboard friendly and take more time for data entry. So later I added a simple text box with date validation. It works fine. However, the user need to put the date separator also. I wish to put a date entry field that comes with a pre-configured date format and separator, so that the user simply type on the numbers and the field cause a validation as well.
How can I achieve this?
Just use jQuery/javascript to mask the date text field. It will automatically format the date as the user enters the values. Also forces correct validation as it works.
for example jQuery plugins search for :
jquery date mask: http://digitalbush.com/projects/masked-input-plugin/
You can always put three text boxes with the separator as text (as I do in an old ASP classic site)
You need to separate the date in the response and then join it using DateSerial when posted.
When we've created something similar in the past we've allowed the user to enter a date into a textbox in a couple of different ways:
DDMMYYYY
D/M/YYYY
0 (for today)
When the form is submitted we had a simple ASP function to convert DDMMYYYY into DD/MM/YYYY (date string must be 8 characters though because the assumption was 2 digits for DD, insert the separator, 2 for MM, etc.) and check this was a valid date, and an if formdate = 0 then formdate=now() rule.
You need to add some JavaScript validation on the form too though. On the textbox add an onblur event to check for the same things - either 8 digits entered, or a valid date, or a 0 - otherwise alert the user. (I would do this in jQuery if we were redoing it today)
You can get quite helpful with the Javascript "validation" to speed up data-entry if you wanted to, for example if a lot of dates being entered are yesterday or tomorrow allow a -1 or +1, or if data entry is always for the current month but a different day, allow the user to just enter a number - 15 and the Javascript/jQuery converts the string to 15/03/2011.
With HTML 5...textMode="Date"
<asp:TextBox ID="TextBoxDate"
runat="server"
CssClass="form-control" Width="561px"
TextMode="Date">
</asp:TextBox>

Data Type Error when added Input Mask on Date Time Field

i have a date/time field called MyDate. Originally, its format is mm/dd/yyyy and there is no input mask. The Date Picker is also set. I then added input mask using Short date , changed the default input maks to (99-99-0000;;_) and change the format to mm-dd-yyyy. However, when i switch to DataSheet view , all my dates are changed from mm/dd/yyyy to mm-dd-yyyy (which is the correct behaviour right? ) and when I tried to enter a new date or modify existing date, it says "The value you entered does not match Date/Time data type in this column". Plus, the DatePicker is missing. How can I resolve this. thank you
The date time picker is not available if an input mask is applied to a field: http://office.microsoft.com/en-us/access-help/add-and-customize-date-and-time-formats-HA010078108.aspx#_Toc272229486
Regarding the error, have you considered using your regional settings in the control panel, which sets the defaukt date display for all (most?) applications?
Dates in Access are stored as numbers, so you can format them however you like, but I suspect the input mask may need to match the regional settings, although I am not certain.