By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,314 Members | 1,539 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,314 IT Pros & Developers. It's quick & easy.

Formatting Date As YYYY-MM instead of YYYY/MM?

P: n/a
I'm currently presenting certain dates as YYYY/MM because Day=01 is understood.

YYYY-MM, however, looks cleaner to my eye.

But I can't get it to work with both .Format and .InputMask. They seem to
conflict when it's time to save the field's value and an "Illegal format"
message pops.

Anybody managed to pull this off, or am I fighting nature?
--
PeteCresswell
Nov 13 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
(PeteCresswell) wrote:
I'm currently presenting certain dates as YYYY/MM because Day=01 is understood.

YYYY-MM, however, looks cleaner to my eye.

But I can't get it to work with both .Format and .InputMask. They seem to
conflict when it's time to save the field's value and an "Illegal format"
message pops.

Anybody managed to pull this off, or am I fighting nature?


I created a table with DateField, type Date. I created a form with
DateField as a control. I put in 0000\-00;0;_ as the input mask and
yyyy-dd as the format and it seems to work OK.

I didn't put in the Input mask, just the format, and entering 2005-10
works OK too.

Usina A97
Nov 13 '05 #2

P: n/a

In a form, I tend to use a unbound field, then set the day = 1 to the
bound field in the before update event.

I convert back in the Form Current event for those people who like to
"scroll" through the records.

For what it's worth, I don't bother with Input Masks _ever_. If
memory serves, Allen Browne has a page on his site on the pitfalls of
using Input Masks. Certainly worth a view (or two!).


On Thu, 27 Oct 2005 12:30:01 -0700, "(PeteCresswell)" <x@y.Invalid>
wrote:
I'm currently presenting certain dates as YYYY/MM because Day=01 is understood.
YYYY-MM, however, looks cleaner to my eye.
But I can't get it to work with both .Format and .InputMask. They seem to
conflict when it's time to save the field's value and an "Illegal format"
message pops.
Anybody managed to pull this off, or am I fighting nature?

--
Drive C: Error. (A)bort (R)etry (S)mack The Darned Thing

Nov 13 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.