Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Validating DateTime fields

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
hi! i'm working on the fiscal year of a certain date and i need to validate some fields to be limited within the defined fiscal year range. how do you validate date time fields in an edit mask format - yyyy/mm/dd?

for example, the fiscal year starts from 2001/04/01 to 2002/03/31. now, an error should be displayed if the user entered 1999/04/01 (or any date out of bound). also, the focus/cursor should not lose its focus when an error is displayed. acceptable values are from 2001/04/01 up to 2002/03/31..(eg 2002/01/02, 2001/09/19...)

heaps of thx!
 
Why not compare the data entered to your
two dates? i.e.
if date_entered >= fy_start AND
date_entered <= fy_end THEN
all ok
else
not ok
end if

From there its a matter of choosing the proper
return code to keep the focus on the field (I
assume you are using a dw).

- Matt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top