Comparing data in Visual Basic .NET

110 pts.
Tags:
ListBox
VB.NET
Visual Basic
Can some one help Listbox1 is Data A,B,C,D,E from the SQL base . Id automatically increases every day after entering new values for A,B,C,D,E while Id is date Every day I want to compare data of the last day with the past 4 day’s data and get values of P1, P2, P3, P4. Listbox1 =Data from base Id A B C D E 15 2 4 6 7 8 14 2 6 8 7 2 13 1 4 1 5 8 12 3 3 3 7 2 11 5 6 8 4 1 10 5 8 7 7 7 9 4 4 7 7 7 8 1 2 6 5 4 7 1 5 8 9 5 6 6 6 3 3 2 5 2 2 5 7 8 4 4 7 5 2 3 3 4 6 8 4 9 2 2 2 4 4 7 1 5 7 5 6 1 Listbox2 = Expected results with VB codes Id P1 P2 P3 P4 15 2 2 1 0 14 0 2 2 0 13 0 0 0 1 12 0 1 1 1 11 1 0 0 1 10 3 0 0 0 9 0 0 0 1 8 1 0 2 0 7 0 0 0 1 6 0 0 1 0 5 1 0 2 1 4 1 0 2 - 3 1 0 - - 2 0 - - - 1 - - - - The problem is that I want through VB codes to add these values to be added to listbox2 Here P1 at Id 15 = 2 is the value got counting when Data A at Id 15 = data A at Id = 14 + Data B at Id 15 = data B at Id = 14 + Data C at Id 15 = data C at Id = 14 + Data D at Id 15 = data D at Id = 14 + Data E at Id 15 = data D at Id = 14 (2 Data A & D) Here P2= 2 is the value got counting when Data A at Id 15 = data A at Id = 13 + Data B at Id 15 = data B at Id = 13 + Data C at Id 15 = data C at Id = 13 + Data D at Id 15 = data D at Id = 13 + Data E at Id 15 = data D at Id = 13 (2 Data B & E) Here P3= 1 is the value got counting when Data A at Id 15 = data A at Id = 12 + Data B at Id 15 = data B at Id = 12 + Data C at Id 15 = data C at Id = 12 + Data D at Id 15 = data D at Id = 12 + Data E at Id 15 = data D at Id = 12 (1 Data D) Here P4= 0 is the value got counting when Data A at Id 15 = data A at Id = 11 + Data B at Id 15 = data B at Id = 11 + Data C at Id 15 = data C at Id = 11 + Data D at Id 15 = data D at Id = 11 + Data E at Id 15 = data D at Id = 11 (0 Data) Etc….etc Even the user wants to compare up to the past 15 data so that I have up to P15 Thanks

Answer Wiki

Thanks. We'll let you know when a new response is added.

So, what are you asking? Do you want someone to write the code for you?

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following