Thanks for your reply. As i mentioned i have two tables and query should check both tables for the existing records. if first name and last name match any of the tables then return count >1 that means value already exist.
i have checked your above query, its just check matching values from two tables. but i want to count value, if value is more than>0 then dont save database. fyi , i am using below code:
query = " select count(first_name | | last_name) count from Auditor, Users where first_name = '" & txt_FirstName.Text & _ "' and last_name = " & txt_LastName.Text
post = SavedAlready(query)
If post > 0 Then
alert = "<script language='javascript'>" & _
"alert ('The User name entered is already in the Project managers list.'); " & _
"</script>"
ClientScript.RegisterStartupScript(GetType(Page), "clientScript", alert)
Exit Sub
End If
Member
16 Points
49 Posts
Re: Need help to check two tables for users name??
Jan 10, 2018 10:20 PM|Rakib1|LINK
Hi,
Thanks for your reply. As i mentioned i have two tables and query should check both tables for the existing records. if first name and last name match any of the tables then return count >1 that means value already exist.
i have checked your above query, its just check matching values from two tables. but i want to count value, if value is more than>0 then dont save database. fyi , i am using below code:
query = " select count(first_name | | last_name) count from Auditor, Users where first_name = '" & txt_FirstName.Text & _
"' and last_name = " & txt_LastName.Text
post = SavedAlready(query)
If post > 0 Then
alert = "<script language='javascript'>" & _
"alert ('The User name entered is already in the Project managers list.'); " & _
"</script>"
ClientScript.RegisterStartupScript(GetType(Page), "clientScript", alert)
Exit Sub
End If