Solved

TDateTime and Edit Masks

Posted on 1998-03-26
4
607 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 50 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Multi-layered image in FireMonkey 9 67
Wincontrol not (correctly) drawn 15 47
Delphi android app hide keyboard 3 43
Firemonkey Listview item popup menu ? 1 32
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

749 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