Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

TDateTime and Edit Masks

Posted on 1998-03-26
4
Medium Priority
?
611 Views
Last Modified: 2010-04-06
I have a field in a Tquery defined as TDateTime (from an Oracle Date column), and all I want to do is allow the user to modify the date portion.  I have a display format of 'm/d/yy', which is fine.  I put a edit mask of '!99/99/00;1;_' which doesn't work the way I want it to.

For example:  When I cursor to that TDBEdit field it changes from 3/20/98 to _3/20/AM and I can't edit it correctly.  Any ideas on what to do?

NOTE:  If the date field has NO time (0) it works fine.
0
Comment
Question by:gjbaker
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 

Expert Comment

by:BigMadDrongo
ID: 1360919
The underscore specified at the end of the edit mask is that character shown in empty characters in the masked edit box, and that is why if you omit then first character in the month field, it will replace it with the underscore.  The only way round this that I'm aware of is to enter the date as 03/20/98.  I personally don't like the masked edit boxes because of this limitation.  Hope this info is useful!
0
 

Author Comment

by:gjbaker
ID: 1360920
I don't have a problem with the underscore, but why does AM show up where the year is suppose to?  It's even worse if I want the year to be four digits.
0
 
LVL 1

Expert Comment

by:Greedy
ID: 1360921
I was going to answer the question but I figured this might just be a work around so I'll put it as a comment

in the OnEnter event of the DBEdit do this
DBEdit.Text := FormatDateTime('MM/DD/YYYY', DBEdit.Field.Value)

that should at least do what you need...some person I work with mentioned this too...I don't know if they fixed it or went with something else...
0
 
LVL 1

Accepted Solution

by:
jturpin earned 100 total points
ID: 1360922
The uderscore in the edit mask is the character used
to fill the spaces. Simply edit the edit mask and replace
the underscore with a space.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question