Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. sponsors. rss.
 From: Borislav Borissov
  Where is Borislav Borissov?
 Sofia
 Bulgaria
 Borislav Borissov
 To: DEREK DODOO
  Where is DEREK DODOO?
 READING, UK
 United Kingdom
 DEREK DODOO
 Tags
Subject: RE: date initialization in table creation
Thread ID: 232169 Message ID: 232170 # Views: 42 # Ratings: 1
Version: Visual FoxPro 6 Category: Databases, Tables and SQL Server
Date: Saturday, June 20, 2009 9:48:58 AM         
   


> Dear Expert,
>
> In the creation of a table, how do you initialize a date field
>
> For instance;
>
> The character fields have 'NULL' placed after them
>
>
<B> CREATE TABLE NEW_TABLE ( IDNO C(6) NULL, DATE_CURR D ___)</B>

>
>
> What do you place after a date field ?
>
>
> Thanks

The NULL didn't initialize the field, it just said that field allow NULLs to be stored in it.
If you want to have a default value you must use DEFAULT clause:
CREATE TABLE NEW_TABLE ( IDNO C ( 6 ) NULL DEFAULT 'Test', DATE_CURR D DEFAULT DATE())
APPEND BLANK
BROWSE NORMAL



-----------------
Borislav Borissov

Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.



COMPLETE THREAD
date initialization in table creation Posted by DEREK DODOO @ 6/20/2009 9:40:21 AM
RE: date initialization in table creation Posted by Borislav Borissov @ 6/20/2009 9:48:58 AM
RE: date initialization in table creation Posted by Ammar Hadi @ 6/20/2009 10:38:04 AM
RE: date initialization in table creation Posted by Cetin Basoz @ 6/20/2009 5:14:45 PM