I need help writing a query that will insert a date into a Date/Time field in MS Accesss.
I have tried:
1.
INSERT INTO receipts (Folio, Amount,Code,DatePaid)
VALUES ('44444',555.55,'TUI4',#03/27/03#)
2.
INSERT INTO receipts (Folio, Amount,Code,DatePaid)
VALUES ('44444',555.55,'TUI4','03/27/03')
3.
INSERT INTO receipts (Folio, Amount,Code,DatePaid)
VALUES ('44444',555.55,'TUI4',#03-27-03#)
4.
INSERT INTO receipts (Folio, Amount,Code,DatePaid)
VALUES ('44444',555.55,'TUI4',#03-Mar-03#)
. . . and a few other variatons that I don't remember
I would appreciate any help.
I am using the queries in a very simple VB 6.0 [using an Execute SQL statement that executes SQL that I type into a text box] application.
I can insert strings, integers, currency values . . . but not the date. I want to be able to insert a user-entered date and also the current date/time as a kind of timestamp.
I have to be able to insert a date/time value as the date/time field is part of the key in the table.
I'm used to doing this kind of thing in SQL Server Stored procs with date variables . . .
Thanks!
Robin
I have tried:
1.
INSERT INTO receipts (Folio, Amount,Code,DatePaid)
VALUES ('44444',555.55,'TUI4',#03/27/03#)
2.
INSERT INTO receipts (Folio, Amount,Code,DatePaid)
VALUES ('44444',555.55,'TUI4','03/27/03')
3.
INSERT INTO receipts (Folio, Amount,Code,DatePaid)
VALUES ('44444',555.55,'TUI4',#03-27-03#)
4.
INSERT INTO receipts (Folio, Amount,Code,DatePaid)
VALUES ('44444',555.55,'TUI4',#03-Mar-03#)
. . . and a few other variatons that I don't remember
I would appreciate any help.
I am using the queries in a very simple VB 6.0 [using an Execute SQL statement that executes SQL that I type into a text box] application.
I can insert strings, integers, currency values . . . but not the date. I want to be able to insert a user-entered date and also the current date/time as a kind of timestamp.
I have to be able to insert a date/time value as the date/time field is part of the key in the table.
I'm used to doing this kind of thing in SQL Server Stored procs with date variables . . .
Thanks!
Robin