date Input mask

Cindy

Registered User.
Local time
Yesterday, 21:57
Joined
Jul 3, 2014
Messages
160
okay what am I doing wrong? I have a date field on my form and used

Input Mask L<LL\-0000;;* and
validation rule <=Date$()

I want the user input to look like 'Aug-2010' for example.

but I get error: The value you entered isn't valid for this field :banghead:
 
probably because the field requires a date and Aug-2014 is missing a day. Not sure what you would do to get the required input mask

Looks like a really tricky way for a user to enter a date - why not change it to a numeric field and have the user enter 201408 - or select from a dropdown list of months and years
 
we don't need the day just month and year... I guess I'll have to include regardless. Thanks CJ
 
really? what should I use then:confused: I'm seriously bummed by this one. Please see the attachment. The error also says

"...you may have entered text in a numeric field or a larger number that the fieldsize setting permits"

But the data type is Date/Time!!!:banghead:
 

Attachments

  • dateERROR.jpg
    dateERROR.jpg
    42.2 KB · Views: 145
It depends on what you are using the control for - is it to determine a search criteria based on a date (i.e. an unbound control) or to complete a date field in a table?
 
the table records a number of incidents and at certain periods, an analysis will be carried out based on the month period and number of occurrences
 
so in essence I want that field to record the date (preferably minus the day but...) for that particular record
 
Ah, sorry just realised you are doing this in table design.

In which case depends on how you are using the data.

My preference is as per my original post, have a field type long and setup the mask, validation etc along the following lines

attachment.php


The input will look like 2014(07) for this month but stored as 201407

Just seen you next post. If you have a table recording the incidents, surely one of the fields you will have will be the date of the incident - in which case you can easily filter on this field to find the month. For example

Code:
WHERE year(IncidentDate) & month(incidentDate)=Year(date()) & month(Date())
will find the incidents for this month
 

Attachments

  • ScreenHunter_03 Jul. 24 14.56.jpg
    ScreenHunter_03 Jul. 24 14.56.jpg
    15.5 KB · Views: 604
maybe its vanity;) but I just want the user entry to be in the format mmm-yy. If this is next to impossible, then dd-mmm-yy. How would I manipulate your code below to give this..? I tried but it didn't work:o
 
for a number (or date), I don't think it is possible to mix numeric and alpha and convert an input into either number or date as part of your validation in the table. If you do it in the form instead, you can have an unbound control for the user to enter the data then something in the before update event of the control to validate the entry. But it will be complex and I regret I don't have the time right now to play around with a possible solution.

If you are going for dd-mmm-yyyy then I would stick with a date datatype, the medium date input mask and modify the validation rule to only allow an entry of 1st of the month (i.e. day([thisfield]) =1) as well as checking it is before today.

However I do think you are making it very difficult for your users to complete and they will no doubt be cursing your vanity in the future:D

Why don't you ask them what they would prefer?
 
yeah my head hurts and I've spent too long on this already. Vanity be gone! Thanks
 

Users who are viewing this thread

Back
Top Bottom