473,659 Members | 2,609 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Need help to insert date

10 New Member
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 9593
PEB
1,418 Recognized Expert Top Contributor
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
kiask2343
10 New Member
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
kiask2343
10 New Member
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
7379
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 atmosphere. Good food.", " (Harry Houdini - 03/01/2004)"); INSERT INTO `reviews` VALUES("", "Le Chow Place", "Lunch", "yada yada", " (Herbert Hoover - 03/03/2004)"); INSERT INTO `reviews` VALUES("", "Golden Dragon", "Lunch", "Exquisite.
0
9870
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 ********************************** package Celcom.Client;
2
1653
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. PAY contains payments to employees and the dates each payment was made. CHG contains dates employees were hired and to what group they belonged. CHG also contains any changes (updates) to which group they belong along with the effective date of...
1
2068
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() & "')" the timestamp field is of type date/time in the ms access database. I get an error saying the insert statement is invalid. Cannot get you the exact error, my server is down. But it seems that the syntax is correct.
25
2688
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 also calculate the interval if the start time is before midnight and the stop time is after midnight? Regards, BTJ
1
2517
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 then don't. I need to check setgroup. If the one in the row matches the one of the insert then do the update otherwise don't. Here is my code for the insert update.
1
2323
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 there has been activity In part II I then want to select the most recent effective dated record (if any and whether it existed before this run or was generated by an earlier insert) and sum it with the record for this date
21
1885
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#, DATE, QUANTITY), the key is PREFER(I#, C#), the key is I'm trying to construct the following query (in SQL)
9
3937
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 - I have read every post out there and spent hours trying to figure out the problem with no success whatsoever - I have constrained the problem to one form however, and I think it's hiding somewhere in my code associated with this form, which is...
7
5331
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 date System.out.println(string_dob); s.Info_DOB=Date.valueOf(string_dob); runs perfectly fine in the method insert() and throws up an illegal Exception in the method UPDATE.This is the error I get when I pass a date "1979-05-02"
0
8341
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8851
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8751
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8539
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8630
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7360
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6181
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4176
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
1982
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.