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

comparing in database

2
Does somebody know how I can compare two items in a sql database?

code goes like this:

While classgroup.Read
if ??????????????????????????????????
strNew = "net group " & classgroup(1) & " /add"
strAll = strAll & vbCrLf & strNew
end if
End While


I want to compare the value of classgroup compared with the next classgroup,
and if the classgroup isn't the same, put it in the string (strAll)
May 17 '07 #1
3 903
TRScheel
638 Expert 512MB
Does somebody know how I can compare two items in a sql database?

code goes like this:

While classgroup.Read
if ??????????????????????????????????
strNew = "net group " & classgroup(1) & " /add"
strAll = strAll & vbCrLf & strNew
end if
End While


I want to compare the value of classgroup compared with the next classgroup,
and if the classgroup isn't the same, put it in the string (strAll)
Create a string outside the while loop to hold the previous string. If the string does not equal the current string, (or strNew), then add the previous string to the strAll
May 17 '07 #2
Frinavale
9,735 Expert Mod 8TB
Does somebody know how I can compare two items in a sql database?

code goes like this:

While classgroup.Read
if ??????????????????????????????????
strNew = "net group " & classgroup(1) & " /add"
strAll = strAll & vbCrLf & strNew
end if
End While


I want to compare the value of classgroup compared with the next classgroup,
and if the classgroup isn't the same, put it in the string (strAll)
Read from your database.
Grab the first row of data and save it into a variable.
Loop
Grab the next row of data, compare it to the first....
End Loop.

??
May 17 '07 #3
puma
2
thanks for the responses,
but the problem is when I save them both to a string
both string would have the same value, it would just compare to the same string

I did this

While classgroup.Read
strprevious = classgroup(1).tostring
strnext = classgroup(1).nextresult.tostring
if strprevious <> strnext then
strNew = "net group " & classgroup(1) & " /add"
strAll = strAll & vbCrLf & strNew
end if
End While

I don't know if I did right with the classgroup(1).nextresult, because it always gives the same value as the strprevious
May 18 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

11
by: Dimension7 | last post by:
All, I am comparing to functions to see which is "better". In better, I mean more efficient, optimize, faster, etc. I have read other posts from other boards, but I'm not really sure of the...
4
by: lasmit | last post by:
I am updating a C# web project which stores the contents of an ASP web form in an SQL Server 2000 database. Originally the code deleted all the current contents of the database and then...
2
by: Duppypog | last post by:
I'm trying to compare a date stored in a database with today's date using an If statement, but it's not returning true. Example, value in database is 11/5/2003 with today being 11/6/2003. Can...
19
by: Dennis | last post by:
I have a public variable in a class of type color declared as follows: public mycolor as color = color.Empty I want to check to see if the user has specified a color like; if mycolor =...
5
by: Kermit Piper | last post by:
Hello, I am comparing two date values, one from a database and one that has been converted from a hard-coded string into an actual Date type. So far so good. The problem I'm having is that one...
21
by: Kristaps | last post by:
Hi everyone! I have some questions, maybe someone can help me... I write script for table comparing, but it works wery slovly. There is the script, can anyone give some tip how can I make this...
4
by: cheryl | last post by:
I am using the PHP.MYSQL and Apache server application in developing my website. I have problem in comparing dates. Website has room reservation, the user will check first the room availability. The...
2
by: Pugi! | last post by:
hi, I am using this code for checking wether a value (form input) is an integer and wether it is smaller than a given maximum and greater then a given minimum value: function...
2
by: satishkuku | last post by:
I entered string in the html form... and stored in Mysql database. After retrieving from the database .. i am comparing orginal string and read string from database.... it is giving both are not...
4
by: ByB | last post by:
Hello, I would like to make a comparison between two databases in SQL server, to find differences between tables, procedures and so on. I have searched the web and found several softwares able...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.