|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
SQL Statement
May i know can i do this?
Dim strSQL as String = "select count(*) as 'count' from Login where UserName = '" & txtLogin.text & "' and Password = '" & txtPassword.text & "' and '" & txtType.text & "' = Type;" |
|
#2
|
|||
|
|||
|
there are 2 AND in this statement.. i need to compare 3 Fields in my SQL database... The UserName, The Password and the Access Type...
|
|
#3
|
||||
|
||||
|
should be something like this
Code:
Dim strSQL as String = "SELECT COUNT(*) As 'count' FROM Login where UserName = '" & txtLogin.text & "' AND Password = '" & txtPassword.text & "' AND '" & txtType.text & "' = 'Type'" |
|
#4
|
|||
|
|||
|
so do u mean SQL statements allow the use of 2 or more "AND"
|
|
#5
|
||||
|
||||
|
Yes, you can have multiple "AND" statements
Example: Code:
SELECT * FROM table1 WHERE field1 = '" & field1 & "' AND field2 = '" & field2 & "' AND field3 = '" & field3 & "' AND etc... |
|
#6
|
|||
|
|||
|
thanks alot
|
![]() |
| Viewing: ASP Free Forums > Database > Microsoft SQL Server > SQL Statement |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|