473,385 Members | 1,838 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

How to add date in access database

I am trying this:
SQL = "INSERT INTO GradeList (Date) Values(#01-01-2007#)"

I get message "Syntax error in Insert statement".

How to add date field in access database?


Feb 27 '07 #1
4 2155
By enclosing Date in square brackets or renaming the column not using a
reserved word.

SQL = "INSERT INTO GradeList ([Date]) Values(#01-01-2007#)"

SQL = "INSERT INTO GradeList (the_Date) Values(#01-01-2007#)"

Bob Lehmann
"Tony" <to******@hotmail.comwrote in message
news:es**********@magcargo.vodatel.hr...
I am trying this:
SQL = "INSERT INTO GradeList (Date) Values(#01-01-2007#)"

I get message "Syntax error in Insert statement".

How to add date field in access database?


Feb 27 '07 #2
On Tue, 27 Feb 2007 14:30:50 +0100, "Tony" <to******@hotmail.comwrote:

¤ I am trying this:
¤ SQL = "INSERT INTO GradeList (Date) Values(#01-01-2007#)"
¤
¤ I get message "Syntax error in Insert statement".
¤
¤ How to add date field in access database?

The keyword Date is reserved (it's a function). Use a different name for your column.
Paul
~~~~
Microsoft MVP (Visual Basic)
Feb 27 '07 #3
Hi,

First of all there is no need to post to so many groups at the same time.

Regarding your problem, Date is a reserved word, you have to refer to it as
[Date]
Additionally I would suggest you to use parametered queries.

"Tony" <to******@hotmail.comwrote in message
news:es**********@magcargo.vodatel.hr...
>I am trying this:
SQL = "INSERT INTO GradeList (Date) Values(#01-01-2007#)"

I get message "Syntax error in Insert statement".

How to add date field in access database?


Feb 27 '07 #4
Ignacio

I suggest you take your C# _CRAP_ and shove it up your ass.

If I want to get your advice, I'll call the cSharp FAGS i promise

your langauge doesn't EXIST

On Feb 27, 2:29 pm, "Ignacio Machin \( .NET/ C# MVP \)" <machin TA
laceupsolutions.comwrote:
Hi,

First of all there is no need to post to so many groups at the same time.

Regarding your problem, Date is a reserved word, you have to refer to it as
[Date]
Additionally I would suggest you to use parametered queries.

"Tony" <tonya...@hotmail.comwrote in message

news:es**********@magcargo.vodatel.hr...
I am trying this:
SQL = "INSERT INTO GradeList (Date) Values(#01-01-2007#)"
I get message "Syntax error in Insert statement".
How to add date field in access database?

Feb 27 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Dino | last post by:
I am creating a website that is going to ask the user to enter a date! then from an access database get all records where a date field is greater then the date entered! Sounds simple, I do it in...
3
by: Mike Dundee | last post by:
I am importing data into a new database (the database still has to be set up) and have a problem. The comma delimited text files I am importing have four fields containing date and date/times. ...
2
by: Riegn Man | last post by:
I have a problem with access and our time clocks. We have time clocks that put out a .log file with the badge swipes for everybody. There is one .log file for each day. I am pulling that data...
3
by: Jim in Arizona | last post by:
I have a gridview that's being populated from an access db query. The problem I'm having is that the date/time fields in access that are populating the gridview are showing both date and time, when...
8
by: nishkrish | last post by:
Hi, I am new to access I created the form and report from Allen Browne's Frmwhat Date the way he has described but when i preview report it shows StartDate: name? Enddate: name? am i suppose...
4
by: SilentThunderer | last post by:
Hey folks, Let me start out by letting you know what I'm working with. I'm building an application in VB 2005 that is basically a userform that employees can use to "Clock in". The form...
10
by: ARC | last post by:
Hello all, General question for back-end database that has numerous date fields where the database will be used in regions that put the month first, and regions that do not. Should I save a...
3
by: Harlequin | last post by:
I must start this posing by making the point that I am NOT a VB programmer and I'm something of a Newbie to MS Access. I can program in a number of languages (Java, Javascript, PERL,PHP and TCL) but...
30
by: fniles | last post by:
On my machine in the office I change the computer setting to English (UK) so the date format is dd/mm/yyyy instead of mm/dd/yyyy for US. This problem happens in either Access or SQL Server. In the...
3
by: janetopps | last post by:
I have a news website, with asp pages, which was on Access, and i upgraded to MySQL, i used Bullzip to transfer the data. It had about 1000 pages, which im now able to pull up on the public side. Im...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.