Solved

datetime

Posted on 2002-05-23
7
341 Views
Last Modified: 2010-04-04
how can i make sure the entered datetime is a valid datetime through a grid
0
Comment
Question by:palabros
7 Comments
 
LVL 12

Expert Comment

by:Lee_Nover
ID: 7029715
try it :)


function ValidateDT(const DateTime: string; var DT: TDateTime): Boolean;
begin
  try
    DT:=StrToDateTime(DateTime);
    Result:=true;
  except
    DT:=0.0;
    Result:=false;
  end;
end;
0
 
LVL 9

Expert Comment

by:ITugay
ID: 7031394
Hi palabros,


use OnSetEditText event to check typed by user data.

-----
Igor.
0
 
LVL 4

Expert Comment

by:nestorua
ID: 7033216
HI,
You can use TDateTimePicker to give the user to choose the date instead of entering it.
Sincerely,
Nestorua.
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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.

 

Author Comment

by:palabros
ID: 7033999
hi nestorua
Can i use a datetimepicker in a grid .again as my datetime is keyfield i am having some trouble with findkey.
can anybody tell me how can we pass datetime field to findkey so as to check for duplication.
i am facing a problem such that 04/10/92 and 10/04/92 are
seems to be fetching the same results.
in which way am i supposed to proceed.

hi lee nover
thanks for the code but this code i have to use i before post events and i am having hell of trouble with handling
events as i really find it difficult to study the sequence of its occurence.
thanks
jon
0
 
LVL 4

Accepted Solution

by:
nestorua earned 50 total points
ID: 7034181
HI,
TDateTimePicker will be appear ONLY when you try to edit that
Field of type TDateTime.
So it will not effect (impact) on your searching.
As for 04/10/92 and 10/04/92: if those values are in the Field of type TDateTime then they are different (April and October).
So, to my mind you should not consider them as the same.
Sincerely,
Nestorua.
0
 

Author Comment

by:palabros
ID: 7038982
hi nestorua ,i have finally reached on to a solution of editmask. and now things r working fine
thanks for u r comments
0
 
LVL 4

Expert Comment

by:nestorua
ID: 7039040
HI,
You are welcome, glad my help was useful.
Sincerely,
Nestorua.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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
Convert Jpg /PNG To GIF 5 150
delphi prevent click fast 2 238
Dev Express grid collapse 2 45
how to resize animated Gif image in delphi ? 1 34
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…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

839 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