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

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 1273
What's the trick? Merging the tables and then sorting by the first date?

RobinS.
-----------------------------------------
"ApeX" <mm****@gmail.comwrote in message
news:90**********************************@i72g2000 hsd.googlegroups.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...@imnottelling.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.comwrote in message
news:e3**********************************@d21g2000 prf.googlegroups.com...
On 9 velj, 08:59, "RobinS" <rob...@imnottelling.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
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...
6
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...
5
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
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...
1
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...
6
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...
3
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:...
5
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
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...
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
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...
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...
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
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,...

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.