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

Update query on definite record(row) of table.

I have a two column table which has a value for the current calendar year on
a definite row(record) of the table, which could be described as ID=100.

The value is in a field called txtValue. There are over 100 records in this
table. I want to be able to look at the Datepart("yyyy", Date()) and update
the value in txtValue in record ID=100 to that value.

I would like to do it with an update query. Is that possible? If so, how,
if not, how do I achieve this. It has to be done programmatically, as it is
just a part of a larger procedure.

TIA
dixie
Feb 12 '06 #1
2 1895
"Dixie" <di***@dogmail.com> wrote in
news:43******@duster.adelaide.on.net:
I have a two column table which has a value for the current
calendar year on a definite row(record) of the table, which
could be described as ID=100.

The value is in a field called txtValue. There are over 100
records in this table. I want to be able to look at the
Datepart("yyyy", Date()) and update the value in txtValue in
record ID=100 to that value.

I would like to do it with an update query. Is that possible?
If so, how, if not, how do I achieve this. It has to be done
programmatically, as it is just a part of a larger procedure.

TIA
dixie

Do you mean that the ID column is the primary key of the table?.
If so then just:
UPDATE TableName
SET TableName.txtValue = Datepart("yyyy", Date())
WHERE ((tablename.ID)=100);

--
Bob Quintal

PA is y I've altered my email address.
Feb 13 '06 #2
Silly me, how simple.
Thanks Bob.
dixie

"Bob Quintal" <rq******@sympatico.ca> wrote in message
news:Xn**********************@207.35.177.135...
"Dixie" <di***@dogmail.com> wrote in
news:43******@duster.adelaide.on.net:
I have a two column table which has a value for the current
calendar year on a definite row(record) of the table, which
could be described as ID=100.

The value is in a field called txtValue. There are over 100
records in this table. I want to be able to look at the
Datepart("yyyy", Date()) and update the value in txtValue in
record ID=100 to that value.

I would like to do it with an update query. Is that possible?
If so, how, if not, how do I achieve this. It has to be done
programmatically, as it is just a part of a larger procedure.

TIA
dixie

Do you mean that the ID column is the primary key of the table?.
If so then just:
UPDATE TableName
SET TableName.txtValue = Datepart("yyyy", Date())
WHERE ((tablename.ID)=100);

--
Bob Quintal

PA is y I've altered my email address.

Feb 13 '06 #3

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

Similar topics

2
by: amwi | last post by:
I have tried to solve this on my own for a long time now, so i really need some help here... I use Oracle 10.1 and SQL *plus 10.1. How do i update table a.fkid from table b.pkid with the...
2
by: Mike Leahy | last post by:
Hello all, This question is related to updating tables - is there any way to calculate or update the values in a column in a table to the values in a field produced by a query result? An...
9
by: baonks | last post by:
hello all here is my problem: I have 2 table 1: K_POS SALDO_A_D SALDO_A_K 11100 105 5 11200 5 105
1
by: H5N1 | last post by:
hi there the topic says it all. I have a outer join select statement in tableadapter that populates GridView, I want to make it updatetable, so I need to provide an update command for table...
2
by: Paul712 | last post by:
Recently, I have a table that I use to update a master table. When I run the same Update query that's been successful in the past, most all of the data in the fields in the update fields has been...
5
by: keeps21 | last post by:
A little problem I've run into is the following. I have a script that allows a user to edit a story. I have an HTML form for title and main_text which gets it's values by pulling the selected...
1
by: mrobinsc | last post by:
** This SQL statement returns 4 rows SELECT COUNT(*) G.ACTIVITY_ID G.RESOURCE_TYPE G.RESOURCE_CATEGORY G.RESOURCE_SUB_CAT G.ANALYSIS_TYPE G.PROJECT_ID
4
by: Michael R | last post by:
Hi everyone. For a coding of something which seem too long to explain, I need to find out, by .recordset or any other way, whether or not I (the user) am standing on the new record row in a form....
1
by: apking | last post by:
Hi, Iam trying to update row in table.its not working.iam write this code.what is wrong in it. <?PHP session_start(); if (isset($_SESSION)) {
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: 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...
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
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...
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
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...

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.