473,396 Members | 2,085 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,396 software developers and data experts.

Insert Into Table Using Field Criteria

2
This seems like it would be a straightforward function, but after searching all morning I'm a bit stuck.

Into an exsiting db, I'd like to update a field (called "week") in rows with certain dates (listed in another field called "time"). The table is called "digi".

Here's what I tried, but it appears that this should be pulling the data from a second table. Is ther a way to send the data, in this case very simple "3" to the rows with specific dates?

Expand|Select|Wrap|Line Numbers
  1. INSERT INTO digi SET week='3' WHERE time BETWEEN '2008-01-14 00:00:04' AND '2008-01-16 02:40:04';
Any guidence would be greatly appreciated.
Jan 17 '08 #1
1 2222
vinic
2
This seems like it would be a straightforward function, but after searching all morning I'm a bit stuck.

Into an exsiting db, I'd like to update a field (called "week") in rows with certain dates (listed in another field called "time"). The table is called "digi".

Here's what I tried, but it appears that this should be pulling the data from a second table. Is ther a way to send the data, in this case very simple "3" to the rows with specific dates?

Expand|Select|Wrap|Line Numbers
  1. INSERT INTO digi SET week='3' WHERE time BETWEEN '2008-01-14 00:00:04' AND '2008-01-16 02:40:04';
Any guidence would be greatly appreciated.

Sorted this on my own. Found the update function could do this:

Expand|Select|Wrap|Line Numbers
  1. UPDATE digi SET week=3 WHERE time BETWEEN '2008-01-14 00:00:04' AND '2008-01-16 02:40:04';
Sorry to take up space..... maybe this'll help another noob sometime.
(or me, when I'm looking for the same answer next year!)

Offward!!! UnChristian Soldiers.
Jan 17 '08 #2

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

Similar topics

0
by: lea | last post by:
I have two combobox, I let the user to select report criteria FROM xx TO xx. i have a button call btnPrint to select report criteria and print according to the criteria. I able to SELECT the...
3
by: takilroy | last post by:
Hi, Does anyone know of a simple way to do this? I want to create an insert trigger for a table and if the record already exists based on some criteria, I want to update the table with the...
16
by: Philip Boonzaaier | last post by:
I want to be able to generate SQL statements that will go through a list of data, effectively row by row, enquire on the database if this exists in the selected table- If it exists, then the colums...
3
by: colmobrien | last post by:
Help Needed ms access 2000 I have a table where one field is the year end monthr (January, February,........, December) and another field is the year end day (1,2,3,........,31) i want to...
4
by: wizof103 | last post by:
When I try to insert a new record on a form, I get the following error. " You can't go to the specified record". The iInsert/New Record command is not available. Any ideas. Thanks in a dvance
33
by: Geoff Jones | last post by:
Hiya I have a DataTable containing thousands of records. Each record has a primary key field called "ID" and another field called "PRODUCT" I want to retrieve the rows that satisy the following...
3
by: Bob Alston | last post by:
I have a routine to copy data to new versions of my app via insert into sql statements. Unfortunately, due to evolution of my app, sometimes the new version has more restrictive editing than an...
1
by: Jan | last post by:
I have a table with autoincrement unique ID plus name (required not to be blank) and other fields. I have a list of names in another table and would like to do insert to the name field of the...
2
by: David - Australia | last post by:
G'day from Australia, I'm hoping some bright spark may be able to help me with this one. I'm sure that it can be done, I've just hit a wall with it. So I'm opening it up. I'm storing student...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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,...
0
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...
0
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...
0
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...
0
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,...

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.