I need help with sql statement that includes two tables
one table has id and name, lets call it tbluser
second table has id and all other info, lets call it tblinfo

Something like this
Select id from tbluser where name = txtname
Select * from tblinfo where id = id selected from first table

I know how to do this with two select statements, wondering how to do it in one

Re: sql statement 80 80

Hi,

It will look something like this:
Select tbluser.id, tblinfo.* from tbluser, tblinfo where tbluser.id=tblinfo.id

Re: sql statement 80 80

The following are my two select statements which work perfectly
How exactly would you do that in one?

adouser.RecordSource = "SELECT * FROM tbluser WHERE name = '" & struser & "'"
    adouser.Refresh
    adoreminder.RecordSource = "SELECT * FROM tbltermin WHERE reminder <= " & Format$(Now, "\#m\/d\/yyyy hh:mm:ss\#") & _
                               "AND userid = " & adouser.Recordset("id") & _
                               "AND remind = " & "true"
    adoreminder.Refresh
Re: sql statement 80 80

ok, I figured it out, here is what I did, thanks for your help
adoreminder.RecordSource = "SELECT * FROM tbltermin INNER JOIN tbluser ON tbltermin.userid = tbluser.id Where tbluser.name = '" & struser & "'" & _
"AND tbltermin.reminder <= " & Format$(Now, "\#m\/d\/yyyy hh:mm:ss\#") & _
"AND remind = " & "true"

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.18 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.