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

Update Value Based on Most Recent Record

294 256MB
I am creating payouts, that can increase or decrease in value based on their NetAssetValue, which is determined each quarter.

I have a Payroll Request table and NAV table. I am trying to update each record in the payroll request table with the most recently entered NetAssetValue. Now, I have a query that gets just that, however it appears it isn't compatible with an Update query. (I tried)

Anyone have any other ideas on how to do this?

Again, I am trying to get the most recent record from one table and update it to another. (Only using that 1 most recent value)
Dec 13 '13 #1
4 1717
zmbd
5,501 Expert Mod 4TB
WHY?
If the value is stored once, then you do not need to normally store it a second time - this breaks the rules of normalization (> Database Normalization and Table Structures. )

The query returns the correct value for each quarter yes? Then use that value directly in your calculations, reports, or whatever else you need.

Another thing, you haven't provided the SQL behind your query. Without that we can't begin to tell you why it's not suitable for an update query. Open in design view, change to SQL view and copy, come here, click on the [CODE/] and paste the SQL between the text.

You should be able to create a simple select query against the query that returns your value. Once done, use this as your update action query.

If you wish to use vba then you can open a recordset against your stored query and then pull that value out and use it in a standard update query that way too.
Dec 14 '13 #2
mcupito
294 256MB
Thanks for the reply, zmbd. It's weird. The NAV Date is the identifying field to determine the Net Asset Value (because they are simply updated quarterly) However, when I run through each query 1 by 1, it puts a random date of 2/27/1906 in the NAV Date field. Somewhat odd?
Dec 16 '13 #3
zmbd
5,501 Expert Mod 4TB
... wierd... we will really need the SQL of the query to figure out what is happening.
Dec 16 '13 #4
mcupito
294 256MB
I figured it out. The query didn't have the appropriate joins. Thanks for your help, zmbd.
Dec 18 '13 #5

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

Similar topics

3
by: Tim Morrison | last post by:
MSSQL2000 I have a table that contains customer transactions CustomerID Transaction TransactionDate .... I need to select the most recent record that matches a specific CustomerID.
2
by: Shaiguy | last post by:
I have a table containing the following fields: ProjectUpdateID (PrimaryKey) ProjectID UpdateDate I would like to create a Query in Ms Access 2000 which will return me the most recent 2...
4
by: doublej0 | last post by:
I have the following issue when trying to write a SQL statement to accomplish my goal. I have done a lot of research, but have been unsuccessful in creating the query. I have two tables, one with...
1
by: evenprimes | last post by:
Here's the table setup: table1: -key -name table2: -key -modification_date -phone_number
1
by: mlwils2 | last post by:
I'm working with a report that uses three views. There are duplicate records because the 'priority' which comes from one view has changed and SELECT DISTINCT sees it as a separate record. The users...
1
by: Jonathan | last post by:
I have the following query which is retrieving a set of data it is almost what I want but I can not manage to get the result I desire. SELECT r1, r1_dev, r2, r2_dev, date, time FROM output...
9
by: psuaudi | last post by:
i have a table with dates that events occured. it looks something like this: 11/18/2006 1:00PM Open 11/18/2006 1:25PM Close I created a select query that selects the last (most recent)...
7
by: brewer95 | last post by:
I use a form to enter data into a table. The user then has the opportunity to recall the data in the form based on a search to review and update the info. For example, on my menu there is a combo...
1
by: jpgoeth | last post by:
What I'm trying to do is select the most recent record for each customer who created an account between 2004-01-01 and 2007-01-01. I'm using MSQuery. I have this so far: SELECT OrderOrAdjust,...
9
by: mcupito | last post by:
Hello, all. So, I have a Table that consists of a Date and a Value. When the date is the most recent, I'd like to get the NetAssetValue associated with that date, AND use it to multiply to a field...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
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: 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: 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.