Solved

How do i update columns in visual basic based on hour and minutes

Posted on 2002-06-18
1
141 Views
Last Modified: 2010-05-03
I have a row like this in my table table1

Column Names:    col1   col2,  col3         col4       col5           MT1   MT2.......MT48
                PBH,     1,   00000015,     07,       200206180630,, 27,,, 28,,,28,,,27,,,28,,,27,,,27,

If you observe the col5 it is date and time like this: 2002/06/18 06:30 AM

Based on col4 count i get the readings starting from MT1....MT48. In above case i got count:7
and so i got MT1 AND MT7 readings.

The row inserted at 6:30 AM

****
I get a second string like this from a different source:

   PBH,    1,     00000015,    02,     200206180800,,    27,,,29,

If you observe the col5 column it is date and time like this: 2002/06/18 08:00 AM

Before updating the above string into the table1

I want to compare the first row hour and second string hour and i want to update the
columns: MT1.....MT48

some what tricky right, i will tell in detail what i want:
*****

If you take the first row it started at 6:30 AM and count is:7, so it goes and fills from
MT1 to MT7 and my time increments by 15 minute interval, so MT1-->6:30 AM, MT2-->6:45 Am
and so on.. MT7-->8:00 AM

Now if you take second string it started at 8:00 AM and count is:2. Now based on time
it started at 8:00 AM it should skip MT7 because the second string started at 8:00 AM and
there is an overlap of reading and the table must update from MT8-->which will be 8:15 AM
and reading is 29 from second string


so if you observe MT1 reading(27) in first row and second string first value(27)it is same and it is an overlap
of the reading and i want to update the row based on hour from MT8-->8:15 AM with value 29.


so the above scenario is just an example but in real world i get different counts and
different times and i want to apply the same logic for all the cases. How do i do that
in visual basic.

In simple terms i can say i want to update the table based on hour and avoid the duplicate
update if the row already have a value in that hour when compare to second string hour.

0
Comment
Question by:vmandem
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 75

Accepted Solution

by:
Anthony Perkins earned 60 total points
ID: 7091644
Despite repeated reminders from EE Moderators you refuse top maintain your open questions:

How to transfer this string to a sql server table using bcp Date: 02/15/2002 12:05PM PST  
http://www.experts-exchange.com/jsp/qShow.jsp?ta=mssql&qid=20267423
What is the best way to transfer a txt file with data into sqlserver database table Date: 01/31/2002 02:24PM PST  
http://www.experts-exchange.com/jsp/qShow.jsp?ta=mssql&qid=20261802
How to compare the whole string to the sql row in VB Date: 03/26/2002 07:06AM PST
http://www.experts-exchange.com/jsp/qShow.jsp?ta=visualbasic&qid=20281637
Damienm Could you please  answer my comment How to reposition a single character in a string using VB
http://www.experts-exchange.com/jsp/qShow.jsp?ta=visualbasic&qid=20274463
How to validate the date from table1 and inserting into table2 using VB Date: 02/26/2002 08:28AM PST
http://www.experts-exchange.com/jsp/qShow.jsp?ta=visualbasic&qid=20271212
XML Parse error, status code 80 Date: 06/26/2001 01:49PM PST
http://www.experts-exchange.com/jsp/qShow.jsp?ta=visualbasic&qid=20141976
This question is for chandukb this is again me and this one is different question posted on jun 19th
at 5:OO P.M, Date: 06/18/2001 07:29PM PST
http://www.experts-exchange.com/jsp/qShow.jsp?ta=visualbasic&qid=20137649
How to add a new element to an XSL sytle sheet Date: 03/04/2002 05:32PM PST
http://www.experts-exchange.com/jsp/qShow.jsp?ta=xml&qid=20273247
XML Parse error, status code 80 in my XML file Date: 06/26/2001 04:58PM PST  
http://www.experts-exchange.com/jsp/qShow.jsp?ta=xml&qid=20142028

Anthony















0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question