Kamis, 19 Juni 2014

Re: [MS_AccessPros] updating a field with higher value

 

John,
Thanks.  I'll give them a test run tomorrow.

Russ


On 6/19/2014 9:32 PM, John Viescas JohnV@msn.com [MS_Access_Professionals] wrote:
 

Russ-

You need TWO update queries:

UPDATE MyTable
SET Morning = Evening
WHERE Evening > Morning;

UPDATE MyTable
SET Evening = Morning
WHERE Morning > Evening;

John Viescas, Author
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications
SQL Queries for Mere Mortals
http://www.viescas.com/
(Paris, France)

On Jun 19, 2014, at 8:05 PM, Russ dyspoz2@cox.net [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:

I would like to build an update query that updates one of two date
fields in a table. I want to update the date of the oldest date field
to the value of the most recent date field. For example, one field
named Morning has a date of 1/5/2000, and the other field named Evening
has a date of 2/5/2000. The new query should check these two fields,
and update whichever one has the oldest date to the value of the date in
the other field. In this particular example, I'll want to update the
Morning field to the value of 2/5/2000. And if the date situation is
reversed, update the other field.
How can I do that?

Russ

------------------------------------
Posted by: Russ <dyspoz2@cox.net>
------------------------------------

------------------------------------

Yahoo Groups Links

No virus found in this message.
Checked by AVG - www.avg.com
Version: 2013.0.3485 / Virus Database: 3955/7709 - Release Date: 06/19/14


__._,_.___

Posted by: Russ <dyspoz2@cox.net>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (3)

.

__,_._,___

Tidak ada komentar:

Posting Komentar