If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
How to restrict a date from being entered
How to restrict a date from being entered Example: start date/ end date
|
#2
|
|||
|
|||
Huh?
If you are asking for a date, why do you want to prevent one from being entered. Hav no idea what you are asking. Feel free to post full sentences explaining what you are trying to do, including examples. Rick B "HayabusaMan" wrote in message ... How to restrict a date from being entered Example: start date/ end date |
#3
|
|||
|
|||
Rick B wrote: How to restrict a date from being entered Example: start date/ end date If you are asking for a date, why do you want to prevent one from being entered. Commonsense business rules: 1) start_date must have a value, default to current date: CREATE TABLE Test ( key_col INTEGER NOT NULL, start_date DATETIME DEFAULT DATE() NOT NULL, end_date DATETIME, PRIMARY KEY (start_date, key_col) ); 2) end_date cannot being earlier than start_date: ALTER TABLE Test ADD CONSTRAINT non_sequential_dates CHECK (start_date = end_date); 3) When INSERTed, start_date must always equal the current date on the server: ALTER TABLE Test ADD CONSTRAINT start_date_not_current CHECK (start_date = DATE()); In order to stop a column from being UPDATEd, revoke all permissions for the table and provide a PROCEDURE as the only means to INSERT a row and a VIEW to be able to only read the table etc. For details, see the security FAQ. Jamie. -- |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Aggregating Date Data into Weeks and Quarters | Roger | Running & Setting Up Queries | 3 | July 11th, 2004 05:56 PM |
If statement | Doug | Worksheet Functions | 9 | June 28th, 2004 06:13 AM |
more dates!!! | brigid | Running & Setting Up Queries | 6 | May 26th, 2004 10:59 AM |
Formatting dates in Excel | bernrunner15 | New Users | 4 | May 11th, 2004 10:32 PM |