|
-
Jun 20th, 2001, 04:52 PM
#1
Thread Starter
Frenzied Member
tricky - i think (SQL Statement)
here is what am trying to do
i wanna verifty that users 1 - 10 have SAME firstname
so if user 1 and user 7 have "Doink" as firstname
i wanna verify that all others have same name
my question is
is there a way to do this in a easy way?
other than 10^9 combinations?
-
Jun 21st, 2001, 02:09 AM
#2
Not sure if l got that. You want to check a text field in the first ten records of a database is of equal value ?
Code:
rs.movefirst
sName = rs!FirstName
rs.movenext
'
for x = 0 to 8
if rs!Firstname <> sName then
MsgBox "I'm a big Kaftan wearing Blouse"
Exit For
end if
rs.moveNext
if rs.eof then exit for
Next x
Am thinking this is a bit more complex than first appears kovan. Could you elaborate a wee bit more.
-
Jun 21st, 2001, 05:20 AM
#3
Well ...
I, too, would like to solve it/see the solution. Can you please provide more details, Kovan ?
.
-
Jun 21st, 2001, 05:43 AM
#4
Fanatic Member
For the price of a ride in your motor, i offer this:
select distinct [first name], [id] from MyTable
where [first name] In (select [first name] from [MyTable] As Tmp broup by [first name] having Count(*)>1 )
will return a list of ids of the perople who have matching first names...
-
Jun 21st, 2001, 04:44 PM
#5
Originally posted by Gaffer
For the price of a ride in your motor, i offer this:
select distinct [first name], [id] from MyTable
where [first name] In (select [first name] from [MyTable] As Tmp broup by [first name] having Count(*)>1 )
will return a list of ids of the perople who have matching first names...
Nice...................is that your mother in the avatar
Kind of thought he wanted to grab the first ten records of a table and compare names....maybe wrong
And for something completed different this is how we would do it in revelation
Code:
SSelect 10 Customer by Create_Date
Actually just trying to get gaffa to show me how to do it with an SQL statement
-
Jun 21st, 2001, 04:59 PM
#6
Addicted Member
Nice...................is that your mother in the avatar
Kind of thought he wanted to grab the first ten records of a table and compare names....maybe wrong
Are you bald and jealous Jethro, or just old and disapproving?
If that's what you thought he wanted, then what was your first reply supposed to do? All your code did was see if the first name was repeated.
-
Jun 21st, 2001, 05:19 PM
#7
Originally posted by stevess
Are you bald and jealous Jethro, or just old and disapproving?
If that's what you thought he wanted, then what was your first reply supposed to do? All your code did was see if the first name was repeated.
Clearly you don't do a lot of coding Steve, if you read his posting rather than rushing to make your own posts you will note he wants to read the first 10 records to see if the FirstName is the same.
Now admittedly the code is off the top of my head, but was pointing out how you could do it, and then was inquirying on more details. Kovan is pretty good at this sort of thing, so presume he posted in the middle of his vb exam study and missed out a few details.
-
Jun 21st, 2001, 05:32 PM
#8
Addicted Member
[QUOTE]
so if user 1 and user 7 have "Doink" as firstname
i wanna verify that all others have same name
[/QOUTE]
[QUOTE]
if you read his posting rather than rushing to make your own posts you will note he wants to read the first 10 records to see if the FirstName is the same.
[QUOTE]
Who's the one misreading?
What if there are 4 records with the same first name?
Don't get defensive just because someone questions you.
-
Jun 21st, 2001, 05:53 PM
#9
I really think you need to investigate an anger management program there Steve.
A few points
1. Kovan is explicitly trying to determine if the same first name in the first 10 records.
2. As stated code off the top of my head.
3. There are one hell of a lot of ppl on this forum who could run rings around me when it comes to cutting code.
4. Kovan was offering an example of the situation he was testing for.
I would suggest you apply yourself to actually helping some one, rather than coming across with having an attitude.
-
Jun 22nd, 2001, 03:48 AM
#10
Fanatic Member
Ladies ladies ladies. Enough already.
The solution is for Kovan to respond and expand on this issue. I like a bit of bitchslappin', but can we keep it to Chit Chat?
-
Jun 22nd, 2001, 05:34 AM
#11
Well ...
Was just going to suggest that, but stopped for the fear of starting another row.
Kovan, can you please elaborate?
.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|