如何確保end date
比使用德爾福在我的應用程序begin date
更大?如何使結束日期大於我在Delphi中的應用程序中的開始日期驗證?
例如,
如果我輸入我的使用TDBEdit我怎麼能阻止在結束日期之前的開始日期
begin date
爲12/01/2000
,在我結束日期爲12/01/1999
我需要提出一個raise.exception.create('your end date is illogical.');
?
如何確保end date
比使用德爾福在我的應用程序begin date
更大?如何使結束日期大於我在Delphi中的應用程序中的開始日期驗證?
例如,
如果我輸入我的使用TDBEdit我怎麼能阻止在結束日期之前的開始日期
begin date
爲12/01/2000
,在我結束日期爲12/01/1999
我需要提出一個raise.exception.create('your end date is illogical.');
?
當用戶單擊保存按鈕或保存數據(可以使用數據集的BeforePost
事件)時,您可以進行檢查,集中startdate並顯示消息並引發異常。
使用StrToDate()
將兩個字符串轉換爲TDateTime
值,然後您可以使用算術運算符如<
將這些值相互比較。