PC Review


Reply
Thread Tools Rate Thread

compare string values in a recordset

 
 
=?Utf-8?B?a3dfdWg5Nw==?=
Guest
Posts: n/a
 
      19th Jul 2006
Hello everone, I am a newbie and I have a recordset that returns the values

XXXXMain
XXXX1
XXXX2
XXXX3
XXXX4
XXXX5
XXXX6
YYYY1
YYYY2
YYYY3
YYYY4
YYYY5
YYYY6
ZZZZMain
ZZZZ1
ZZZZ2
ZZZZ3
ZZZZ4

but I would like the show the results in a tabular format according to the
first 4 charactes such as XXXX, then YYYY, and finally ZZZZ.

XXXXMain YYYYMain ZZZZMain
XXXX1 YYYY1 ZZZZ1
XXXX2 YYYY2 ZZZZ2
XXXX3 YYYY3 ZZZZ3
XXXX4 YYYY4 ZZZZ4
XXXX5 YYYY5
XXXX6 YYYY6

The select statement is sorting the result set. This result set is
populating a Datatable so I was thinking about somehow while looping through
the result set comparing the first 4 string values and creating a new cell
everytime the string values changes.

Hopefully I explained my intentions clearly.
Thanks In Advance
kw
Thanks in Advance for your assistance.






 
Reply With Quote
 
 
 
 
chanmm
Guest
Posts: n/a
 
      20th Jul 2006
You can use while loop and if to compare the 1st character. VB.NET should
use Dataset than Recordset.

chanmm

"kw_uh97" <(E-Mail Removed)> wrote in message
news:B7835623-EEFB-47E4-88CC-(E-Mail Removed)...
> Hello everone, I am a newbie and I have a recordset that returns the
> values
>
> XXXXMain
> XXXX1
> XXXX2
> XXXX3
> XXXX4
> XXXX5
> XXXX6
> YYYY1
> YYYY2
> YYYY3
> YYYY4
> YYYY5
> YYYY6
> ZZZZMain
> ZZZZ1
> ZZZZ2
> ZZZZ3
> ZZZZ4
>
> but I would like the show the results in a tabular format according to the
> first 4 charactes such as XXXX, then YYYY, and finally ZZZZ.
>
> XXXXMain YYYYMain ZZZZMain
> XXXX1 YYYY1 ZZZZ1
> XXXX2 YYYY2 ZZZZ2
> XXXX3 YYYY3 ZZZZ3
> XXXX4 YYYY4 ZZZZ4
> XXXX5 YYYY5
> XXXX6 YYYY6
>
> The select statement is sorting the result set. This result set is
> populating a Datatable so I was thinking about somehow while looping
> through
> the result set comparing the first 4 string values and creating a new cell
> everytime the string values changes.
>
> Hopefully I explained my intentions clearly.
> Thanks In Advance
> kw
> Thanks in Advance for your assistance.
>
>
>
>
>
>



 
Reply With Quote
 
=?Utf-8?B?a3dfdWg5Nw==?=
Guest
Posts: n/a
 
      20th Jul 2006
Thanks chanmm! Some syntax would be helpful also. I will look into the while
loop in the meantime. I am using C# and using DataSet sorry for the incorrect
usage. But an example would be very helpful!

kw

"chanmm" wrote:

> You can use while loop and if to compare the 1st character. VB.NET should
> use Dataset than Recordset.
>
> chanmm
>
> "kw_uh97" <(E-Mail Removed)> wrote in message
> news:B7835623-EEFB-47E4-88CC-(E-Mail Removed)...
> > Hello everone, I am a newbie and I have a recordset that returns the
> > values
> >
> > XXXXMain
> > XXXX1
> > XXXX2
> > XXXX3
> > XXXX4
> > XXXX5
> > XXXX6
> > YYYY1
> > YYYY2
> > YYYY3
> > YYYY4
> > YYYY5
> > YYYY6
> > ZZZZMain
> > ZZZZ1
> > ZZZZ2
> > ZZZZ3
> > ZZZZ4
> >
> > but I would like the show the results in a tabular format according to the
> > first 4 charactes such as XXXX, then YYYY, and finally ZZZZ.
> >
> > XXXXMain YYYYMain ZZZZMain
> > XXXX1 YYYY1 ZZZZ1
> > XXXX2 YYYY2 ZZZZ2
> > XXXX3 YYYY3 ZZZZ3
> > XXXX4 YYYY4 ZZZZ4
> > XXXX5 YYYY5
> > XXXX6 YYYY6
> >
> > The select statement is sorting the result set. This result set is
> > populating a Datatable so I was thinking about somehow while looping
> > through
> > the result set comparing the first 4 string values and creating a new cell
> > everytime the string values changes.
> >
> > Hopefully I explained my intentions clearly.
> > Thanks In Advance
> > kw
> > Thanks in Advance for your assistance.
> >
> >
> >
> >
> >
> >

>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
hi, how to compare two string values, if the string values r from inputbox in VB srini g Microsoft Excel Programming 1 25th Apr 2008 03:59 PM
How do I compare string values in one column to another column? =?Utf-8?B?TmljayBOLg==?= Microsoft Excel Worksheet Functions 1 29th Apr 2006 02:56 AM
Recordset: retrieve values from recordset using variable for field =?Utf-8?B?QW5uYSBT?= Microsoft Access VBA Modules 2 25th Oct 2004 07:33 AM
Compare String question: == or String.Compare? Blue Ball Microsoft ASP .NET 4 9th Mar 2004 01:25 AM
query to compare values inthe same field + a String Santiago Gomez Microsoft Access Queries 3 10th Jan 2004 02:26 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:39 PM.