I want to SELECT the last four characters from a Social Security Number (SSN) record in a DB field. Here are two things I have tried so far:
Sql1 = "SELECT SSN, DateOfBirth FROM Validation WHERE SSN = " + txtSSN.Text = Right("SSN", 4) + " AND DateOfBirth = " + txtDOB.Text + ""
Sql1 = "SELECT Right("SSN", 4), DateOfBirth FROM Validation WHERE Right("SSN", 4)= " + txtSSN.Text + " AND DateOfBirth = " + txtDOB.Text + ""
I get errors with both of these. Can someone help me out?
Thanks in advance.
Sql1 = "SELECT SSN, DateOfBirth FROM Validation WHERE SSN = " + txtSSN.Text = Right("SSN", 4) + " AND DateOfBirth = " + txtDOB.Text + ""
Sql1 = "SELECT Right("SSN", 4), DateOfBirth FROM Validation WHERE Right("SSN", 4)= " + txtSSN.Text + " AND DateOfBirth = " + txtDOB.Text + ""
I get errors with both of these. Can someone help me out?
Thanks in advance.