|
-
Aug 30th, 2000, 04:51 AM
#1
Let's say I have this in an access recordset (DAO 3.51):
Code:
'ID Name Last Name
'
'0 Robert Point
'1 Mark Stuff
'1 Dicky Other stuff
'2 Freako Yaddayadda
'2 Gulp Packa
'2 Spoofy Blahblah
'3 Frank Click
'4 Shrink Doubleclick
And let's say I want to pull out all the names with '2' as ID. What's the SQL statement to do that?
-
Aug 30th, 2000, 05:19 AM
#2
Fanatic Member
SELECT Name, LastName
FROM TableName
WHERE ID = '2'
VB6 sp5, SQL Server 2000, C#
There are no stupid questions. Only stupid people. 
-
Aug 30th, 2000, 05:33 AM
#3
And what if the table name has spaces in it?
Shoud I use:
SELECT Name, LastName FROM "Table Name" WHERE ID = 2
?
-
Aug 30th, 2000, 05:42 AM
#4
Fanatic Member
SELECT Name, LastName
FROM [Table Name]
WHERE ID = '2'
VB6 sp5, SQL Server 2000, C#
There are no stupid questions. Only stupid people. 
-
Aug 30th, 2000, 05:51 AM
#5
Thanks a lot
-
Aug 30th, 2000, 06:51 AM
#6
Problem 
It only returns the first record with the specified ID.
What's wrong?
-
Aug 30th, 2000, 10:27 AM
#7
Frenzied Member
If you're using a recordset, you'll need to read (movenext) the next record in it...
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
|