473,748 Members | 2,615 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DataTable date issue

hello, can anybody please give me some advice or a pseudocode for the
following:

i got two datatables filled with dates, i need to fill a third
datatable with values from the other two but the trick is:

first datatable
*************** ***
28.8.2007 - 2.10.2007
5.10.2007 - 4.11.2007
5.11.2007 - 31.12.2007

second datatable
*************** ******
11.12.2007 - 21.12.2007
24.12.2007 - 31.12.2007

i have to fill the third datatable with following data :

28.8.2007 - 2.10.2007
5.10.2007 - 4.11.2007
5.11.2007 - 10.12.2007
11.12.2007 - 21.12.2007
22.12.2007 - 23.12.2007
24.12.2007 - 31.12.2007
Feb 8 '08 #1
3 1287
What's the trick? Merging the tables and then sorting by the first date?

RobinS.
-----------------------------------------
"ApeX" <mm****@gmail.c omwrote in message
news:90******** *************** ***********@i72 g2000hsd.google groups.com...
hello, can anybody please give me some advice or a pseudocode for the
following:

i got two datatables filled with dates, i need to fill a third
datatable with values from the other two but the trick is:

first datatable
*************** ***
28.8.2007 - 2.10.2007
5.10.2007 - 4.11.2007
5.11.2007 - 31.12.2007

second datatable
*************** ******
11.12.2007 - 21.12.2007
24.12.2007 - 31.12.2007

i have to fill the third datatable with following data :

28.8.2007 - 2.10.2007
5.10.2007 - 4.11.2007
5.11.2007 - 10.12.2007
11.12.2007 - 21.12.2007
22.12.2007 - 23.12.2007
24.12.2007 - 31.12.2007
Feb 9 '08 #2
On 9 velj, 08:59, "RobinS" <rob...@imnotte lling.comwrote:
What's the trick? Merging the tables and then sorting by the first date?

well, the trick is if the range from the second datatable is withing
some of the ranges in the first datatable,
they must be broken by adding or removing days according to the range
in the previous and next added dates.
for example:

1) 1.11.2007 - 15.11.2007

2). 6.11.2007 - 9.1..2007

so i need to have:

1.11.2007 - 5.11.2007
6.11.2007 - 9.11.2007
10.11.2007 - 15.11.2007
Feb 9 '08 #3
You would have to write your own algorithm for that, parsing the data and
creating a new dataset.

RobinS.
----------------------------
"ApeX" <mm****@gmail.c omwrote in message
news:e3******** *************** ***********@d21 g2000prf.google groups.com...
On 9 velj, 08:59, "RobinS" <rob...@imnotte lling.comwrote:
>What's the trick? Merging the tables and then sorting by the first date?


well, the trick is if the range from the second datatable is withing
some of the ranges in the first datatable,
they must be broken by adding or removing days according to the range
in the previous and next added dates.
for example:

1) 1.11.2007 - 15.11.2007

2). 6.11.2007 - 9.1..2007

so i need to have:

1.11.2007 - 5.11.2007
6.11.2007 - 9.11.2007
10.11.2007 - 15.11.2007
Feb 18 '08 #4

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

Similar topics

6
3295
by: Willie wjb | last post by:
Hi, i have a client program that sends a filter expression to the server PC. On that server PC this filter is put over a datatable and the result is send back. the server can be located on a PC with let's say ddmmyyyy windows date format and the client has mmddyyyy. when the filter expression send is "Date < #31/01/2003#", it will fail on
6
17446
by: Millo | last post by:
Hi I'm trying to call the method Contains in a loop: out of the loop I set the primary key of the dataTable. The method returns true one time at a certani value, but then, when the loop steps forward to check another value, the method returns false, although the value is contained in the dataTable (DateTime values). So the loop goes and goes ...
5
1578
by: Thomas Scheiderich | last post by:
I am having a problem with a Datatable access. This statement apparently works fine: response.write(GetRows.Rows(ktr)(1)) and this statement does not: if e.day.date = GetRows(ktr)(1) then
2
2122
by: ven | last post by:
Hello i have a dynamic datatable in my page. I wanna to write data to textboxes and after click on button "ADD data" i want to refresh datagrid on page... Here is my code : ' Insert page code here ' Dim wykszt as System.Data.DataTable Dim zatru as System.Data.DataTable Dim row as system.Data.DataRow
1
2021
by: cindy | last post by:
Get data into datatable, add to dataset dsSearch " Get data into datatable, add to dataset dsSearch Using In-Memory SQL Engine join the tables and select the filenames from the join, add to dataset dsSearch CODE ON http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=3994&lngWId=10 using SQL connection get data from view on sql server, add to dataset dsSearch
6
4691
by: ronchese | last post by:
Hi. I'm trying to make a criteria string to use in Select() method of a datatable, searching for a date, but it is apparently not working! In one of my tests, I have a datatable with 1 row and a field containing the following value (extracted from Immediate Window): ?dtbSample.Rows(0).Item("COM_STARTDATE") #5/8/2006 9:00:00 AM# {Date} Date: #5/8/2006 9:00:00 AM# (for better understand, consider this date as '2006/05/08')
3
25689
by: Jeff | last post by:
hey ..NET 2.0 I have a datatable which consist of 3 columns (int, date, value). This DataTable have 3 rows, the values of the "date" ("date" column is of datetime datatype) column is: 2007-09-15 00:00:00.000 2007-10-15 00:00:00.000 2007-11-15 00:00:00.000
5
8638
by: Frank Hauptlorenz | last post by:
Hello, I recognized some days ago, that returning a DataTable blocks my WCF-Service. Is this a known bug? If I add this table to a new DataSet() and return this, it works. Thank you, Frank
2
1603
by: Taftheman | last post by:
Hi, I am trying to do some data checking before commiting the data back to the database. I have a datagrid in this data grid i have textboxes. The user can edit what they like. The first row in the datagrid is a phantom row. This is so users can add a row into the grid. I have then used VB.NET to manually get the data from the grid into a datatable. What i need to do is check that the Start date of a record is after the end date of the...
0
8996
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8832
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9562
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9254
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8255
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6799
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4608
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3319
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2217
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.