Hi. This is my first post, so, please, bear with me.
I have two tables:
FIRST: - ID DataEmitere DispIO
-
1 19.10.2011 0,00
-
2 19.10.2011 0,00
-
3 19.10.2011 0,00
-
4 19.10.2011 0,00
-
5 19.10.2011 0,00
-
6 19.10.2011 0,00
-
7 24.10.2011 0,00
-
8 24.10.2011 0,00
-
9 24.10.2011 0,00
-
10 24.10.2011 0,00
-
11 24.10.2011 0,00
-
12 31.10.2011 0,00
-
13 31.10.2011 0,00
-
14 14.11.2011 0,00
-
15 14.11.2011 0,00
-
16 18.11.2011 0,00
-
17 18.11.2011 0,00
-
18 18.11.2011 0,00
-
19 18.11.2011 0,00
-
20 23.11.2011 0,00
-
21 23.11.2011 0,00
-
22 23.11.2011 0,00
-
23 23.11.2011 0,00
-
24 29.11.2011 0,00
-
25 29.11.2011 0,00
-
26 30.11.2011 0,00
-
27 06.12.2011 0,00
-
28 09.12.2011 0,00
-
29 09.12.2011 0,00
-
30 09.12.2011 0,00
-
31 09.12.2011 0,00
-
32 09.12.2011 0,00
-
33 13.12.2011 0,00
-
34 13.12.2011 0,00
-
35 15.12.2011 0,00
-
36 15.12.2011 0,00
-
37 15.12.2011 0,00
-
38 15.12.2011 0,00
-
39 22.12.2011 0,00
-
40 22.12.2011 0,00
SECOND: - ID Data Suma
-
1 01.10.2011 17.027,76 lei
-
2 14.10.2011 4.121,00 lei
-
3 19.10.2011 5.355,00 lei
-
4 24.10.2011 3.645,00 lei
-
5 26.10.2011 4.964,00 lei
-
6 31.10.2011 3.402,00 lei
-
7 14.11.2011 2.196,00 lei
-
8 18.11.2011 8.844,00 lei
-
9 23.11.2011 5.122,00 lei
-
10 29.11.2011 8.829,00 lei
-
11 13.12.2011 4.050,00 lei
-
12 15.12.2011 3.700,00 lei
-
13 21.12.2011 6.162,00 lei
-
14 22.12.2011 3.260,00 lei
I would like, if possible, to insert values from the second table into the first on, according to "Data" field from both. The trick is that, the second table contains less rows and different dates than the first one.
Ex: TABLE 2 - Sum(ROW 1,2,3) --> TABLE 1 - ROW 1
TABLE 2 - ROW 4 --> TABLE 1 - ROW 7
TABLE 2 - Sum(ROW 5,6) --> TABLE 1 - ROW 12
... and so on.
The question is: can I do that with SQL or with VBA?
3 1791
I have no idea how you're linking the two tables. It's unclear from your description.
NeoPa 32,556
Expert Mod 16PB
The answer is probably "Yes", but the question, though you've clearly put some effort into it, is not very clear.
Please explain the logic you are working to so that it makes sense. Example data is good, but is only useful to pad out or clarify an explanation. It's no good to use in place of one.
Welcome to the forum, Tzeposule !
May I ask you why Sum(ROW 1,2,3) from Table 2 must go to Row 1 in Table 1 ? Why not in row 2 ? Or 3 or 4 ? For me looks the same (except the ID, o course).
More than: In what field in Table 1 you wish to put the result ?
I think is better to explain what you wish to achieve. And how you plan to do this (your logic).
I wish to remember that the forum rules say that you must answer in English.
If you wish to explain better in Romanian language you can send me a private message.
I wish to warn you: If you do that (send me PM) yo also must explain your problem HERE, in English. Good luck ! Sign in to post your reply or Sign up for a free account.
Similar topics
by: Benny Chow |
last post by:
Hello,
I need help in writing a SQL statement in MS SQL Server 2000 to select
the latest date (i.e., the date closest to or equal to the current date)
for a given date.
For example, in a...
|
by: Josh |
last post by:
I need a query that will select the closest date.
I have to tables Pricing and InventoryItem.
tblInventoryItem
InventoryItemID <- Pk
Description
tblPricing
|
by: sk |
last post by:
I have the following table
CREATE TABLE Readings
(
ReadingTime DATETIME NOT NULL DEFAULT(GETDATE()) PRIMARY KEY,
Reading int NOT NULL
)
INSERT INTO Readings (ReadingTime, Reading)...
|
by: KoRnDragon |
last post by:
I know about getlastmod() but is there one for created date?
If not is there some other way of getting the created date of a file?
|
by: CK |
last post by:
Good Morning,
I have a view that contains rate information, contractIDs, and effective
dates.
I need to select the rate info based on contractID and date.
I can provide a date and contractID, and...
|
by: randy1200 |
last post by:
I have a DataView (dv) that includes a StartDate DateTime column. I'd like to
return the DataView record that contains a StartDate value closest to my
IncidentDate value:
string filter =...
|
by: josecruz |
last post by:
I hope this make sense...
When students leave school (dropout, medical reasons, etc), there is a date field that admission use to record this event. For program evaluation, I want to know what...
|
by: CatherineA |
last post by:
I need help writing an SQL statement in Access 2007 to select the closest date/time. I have Spot Time (the date/time commercials ran) and Call Time (the date/time we received calls).
I need to...
|
by: GraemeC |
last post by:
I have a form (single record form) that loads records from a query that are sorted date order as the records are viewed in date order. Some dates are in the past and some are in the future. Currently...
|
by: reginaldmerritt |
last post by:
I'm trying to open a form where the value of a field has a date closest to today but not beyond todays date.
I guess i need some sort of MAX function in a where statment maybe????
Any ideas how...
|
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...
|
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
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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: 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,...
|
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...
|
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,...
| |