How to Insert a Record with a Date Field into FoxPro 
Author Message
 How to Insert a Record with a Date Field into FoxPro

I can insert records into FoxPro except when the record has a date field.  I
can't figure out what format FoxPro will accept.  I
have tried several different formats including :

insert into Table(ADate) values ( '#1/1/2001 12:30:00 AM#')
insert into Table(ADate) values ( #1/1/2001 12:30:00 AM#)
insert into Table(ADate) values ( '1/1/2001 12:30:00 AM')
insert into Table(ADate) values ( 1/1/2001 12:30:00 AM)

and none of these work and don't know what else to try.

Any help is appreciated................thanku...dick barney



Sun, 28 Mar 2004 23:53:38 GMT  
 How to Insert a Record with a Date Field into FoxPro
Try to use:

insert into Table(ADate) values ( {1/1/2001 12:30:00 AM})

Regards,



Mon, 29 Mar 2004 20:03:54 GMT  
 How to Insert a Record with a Date Field into FoxPro
Thanks Gary,

It works perfectly.
 Is this documenented somewhere?  I tried and couldn't find anything.

thanku.........dick barney


Quote:
> Try to use:

> insert into Table(ADate) values ( {1/1/2001 12:30:00 AM})

> Regards,



Mon, 29 Mar 2004 20:59:58 GMT  
 How to Insert a Record with a Date Field into FoxPro
Check the SQL ststement syntax of Foxpro for the answer. It can be found
from Microsoft MSDN online documentation at
http://msdn.microsoft.com/library/default.asp.

Regards,



Tue, 30 Mar 2004 09:09:24 GMT  
 How to Insert a Record with a Date Field into FoxPro
Gary,

I am a VB programmer and the last I saw (and never wrote) any xBase was 10
or 12 years ago. I looked in the the MS Library where you directed and
couldn't find anything on Foxpro SQL dates.  Could you come up with an exact
path - because maybe I am using or searching the library inefficiently.

thanku.........dick barney


Quote:
> Check the SQL ststement syntax of Foxpro for the answer. It can be found
> from Microsoft MSDN online documentation at
> http://msdn.microsoft.com/library/default.asp.

> Regards,



Tue, 30 Mar 2004 19:06:22 GMT  
 How to Insert a Record with a Date Field into FoxPro
Here is the article found in MSDN. Though it doesn't address the problem we
are discussing, we can learn something from the article.

HOWTO: Formatting a Date or Time Value to Query an SQL Table
http://support.microsoft.com/support/kb/articles/Q145/8/17.asp

Regards,



Fri, 02 Apr 2004 15:36:40 GMT  
 How to Insert a Record with a Date Field into FoxPro
All you need to do, is to use Curly braces around the date value being passed:

   Insert into Table(ADate) values ( {1/1/2001})

Quote:

> Here is the article found in MSDN. Though it doesn't address the problem we
> are discussing, we can learn something from the article.

> HOWTO: Formatting a Date or Time Value to Query an SQL Table
> http://support.microsoft.com/support/kb/articles/Q145/8/17.asp

> Regards,



Tue, 06 Apr 2004 02:11:21 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. Problem inserting record with date field

2. Problem inserting record with date field

3. inserting dates into FoxPro dbf from vb

4. Inserting VB6 date data into FoxPro dbf

5. insert sql syntax for FOXPRO using ADO with DATE columns

6. insert a record into Foxpro DBF File it using ADO

7. Crystal Reports 8.5 date range parameter field - record selection that includes null date range

8. Inserting current date into a contact's note field

9. Insert current date into form fields

10. Insert date and time field into MS Access with SQL

11. INSERT INTO and UPDATE date field

12. Inserting a date field into SQL

 

 
Powered by phpBB® Forum Software