|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
SQL query in asp page help
hi im trying to get this to work
mySQL3 = "SELECT ViewedBy FROM viewedlist where Nick = '" & userform2 & "' and ViewedBy = '" & userform & "'" but the problem is that there may be more than one record that has the same nick and more than one that has the same viewed by. How do i make it grab only the record where nick and viewed by are in the same row and none else? here is an example. Nick Viewedby ___ _______ Sean Steve Jerry Steve Sean Wilma so with the statement above, it only seems to pull one line, even though Sean is in there twice. and the same for steve. (only Sean/Steve would seem to work if i look for Steve as the Viewedby) i need it to bring back Steve and Wilma if i look for people who viewed Sean. if not the exact statement. thanks for any help you can give. |
|
#2
|
|||
|
|||
|
mySQL3 = "SELECT ViewedBy FROM viewedlist where Nick = '" & userform2 & "' or ViewedBy = '" & userform & "'"
|
|
#3
|
||||
|
||||
|
You need to have a primary key on the table, that makes the records unique.
|
|
#4
|
|||
|
|||
|
hi there
make a primary key on both fields then use uniqueidentifier then try regards ashish mcdba,mct,mcse,mcsd |
![]() |
| Viewing: ASP Free Forums > Database > Microsoft SQL Server > SQL query in asp page help |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|