Solved

TDateTime and Edit Masks

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Delphi 10 Seattle Dataset Actions 5 71
proper way to parse text with delphi 7 89
code issue 8 85
select query - oracle 16 82
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
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…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

747 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now