I have results in a resultset call RSDistinct. The only thing that I have in RSDistinct are all unique product names (Pname).
I then want to use the resultset Pname in a select statement to form a second result set. That second resultset is Called RSTime. I then take the columns from that, there are several and do some logical testing to see if the product is on time or early. After that is done I clear the RSTime and loop back to the RSDistinct resultset. I then want to continue the process until the end of the RSDistinct resultset is reached. The problem is that I am getting a error when I try to use the pname in a select statement for the second resultset. Here is my code:
sqlTime = "select max(date), status, moved_date, removed_date " _
& "from PRODUCT " _
& "where pname = '& RSDistinct("pname"& "' "
Set RSTime = DB.OpenResultset(sqlTime, rdOpenKeyset, rdConcurRowver)
The error is when I refrence the RSDistinct("pname" it says expected end of statement. I have tried several different ways of doing this but to no luck. Anyone have an idea? Is this legal?
I then want to use the resultset Pname in a select statement to form a second result set. That second resultset is Called RSTime. I then take the columns from that, there are several and do some logical testing to see if the product is on time or early. After that is done I clear the RSTime and loop back to the RSDistinct resultset. I then want to continue the process until the end of the RSDistinct resultset is reached. The problem is that I am getting a error when I try to use the pname in a select statement for the second resultset. Here is my code:
sqlTime = "select max(date), status, moved_date, removed_date " _
& "from PRODUCT " _
& "where pname = '& RSDistinct("pname"& "' "
Set RSTime = DB.OpenResultset(sqlTime, rdOpenKeyset, rdConcurRowver)
The error is when I refrence the RSDistinct("pname" it says expected end of statement. I have tried several different ways of doing this but to no luck. Anyone have an idea? Is this legal?