473,382 Members | 1,329 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,382 software developers and data experts.

Need help to insert date

Ok I need a little help here. I need the code to insert todays date into a specific field.
This is what I think I need but I don't know how to make it work.
Expand|Select|Wrap|Line Numbers
  1.  
  2. INSERT INTO target [(field1[, field2[, ...]])] 
  3. VALUES (value1[, value2[, ...])
  4.  
This is how I wrote it.
VBA:
Expand|Select|Wrap|Line Numbers
  1. INSERT INTO WO REG.CLOSEDATE 
  2. VALUES (DATE());
  3.  
  4.  
WO REG is the table and CLOSEDATE is the field.
Sep 22 '06 #1
3 9580
PEB
1,418 Expert 1GB
Hi,
try:

Expand|Select|Wrap|Line Numbers
  1. INSERT INTO [WO REG] (CLOSEDATE)
  2. VALUES (Now());
  3.  
:)


Ok I need a little help here. I need the code to insert todays date into a specific field.
This is what I think I need but I don't know how to make it work.
Expand|Select|Wrap|Line Numbers
  1.  
  2. INSERT INTO target [(field1[, field2[, ...]])] 
  3. VALUES (value1[, value2[, ...])
  4.  
This is how I wrote it.
VBA:
Expand|Select|Wrap|Line Numbers
  1. INSERT INTO WO REG.CLOSEDATE 
  2. VALUES (DATE());
  3.  
  4.  
WO REG is the table and CLOSEDATE is the field.
Sep 22 '06 #2
I get this error when I run the append query:
MS Access can't append all the records in the append query.
MS access set 0 fields to null due to a type conversion failure, and didn't add 0 records to the table due to key violations, 0 records due to lock violations, and 1 record due to validation rule violation.
What I am trying to do is insert the date into a field in the table using a form. I have it set as an append query that is run by a command button.
Sep 22 '06 #3
Problem solved I need to use an update query.
Thanks for the help
Sep 22 '06 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

15
by: Jack | last post by:
I have a text file of data in a file (add2db.txt) where the entries are already entered on separate lines in the following form: INSERT INTO `reviews` VALUES("", "Tony's", "Lunch", "Great...
0
by: James Hong | last post by:
Help please, I try to sending an email from my html page using the java applet. but it give error on most of the PC only very few work, what is the error i make the java applet show as below ...
2
by: Philip Hachey | last post by:
I think this is do-able, and possibly even simple, but it's been too many years since I've done anything significant with SQL. Any help would be appreciated. I have two tables, PAY and CHG. ...
1
by: Jill | last post by:
I am trying to store the current date to an ms access database on my server. I set it up with a dsnless connection. Here is the statement: Insert Into employees(timestamp) Values ('" & date() &...
25
by: Bjørn T Johansen | last post by:
I need to write a SQL that calculates the interval between a start time and a stop time. This is the easy part. The problem is that I only have the time part, i.e. no date, so how can I be sure to...
1
by: admin | last post by:
I have this query which works to insert and update the row. Problem is I need it to check and see if a value in the row is the same as the one being set if it is then do the update part if not...
1
by: new | last post by:
I am building an effective dated file that shows results to date. In part 1 of the select I I process a larges set of input and genrate records for each date in the processing period for which...
21
by: tizmagik | last post by:
Database consists of the following 4 tables with respective attributes: CUSTOMER(C#, CUSTOMER NAME, ADDRESS), the key is ITEM(I#, ITEM NAME, MANUFACTURER, YEAR), the key is BOUGHT(C#, I#,...
9
by: pic078 via AccessMonster.com | last post by:
I need serious help - I have a frontend/backend Access database (2 MDE Files) that remains stuck in task manager after exiting the application - you can't reopen database after exiting as a result...
7
helpwithcode
by: helpwithcode | last post by:
Hi people, I am just learning java.I have been creating a project which involves JDBC Connectivity.I find that the statements, String string_dob=text_dob.getText(); //Converting string to...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
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:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.