Creating SQL with recorset variable (1 Viewer)

GPSPOW

Registered User.
Local time
Yesterday, 21:28
Joined
Apr 25, 2012
Messages
27
I have a SQL statement to create a query with a where condition coming from a recordset value.

When I process the following code, the variable name comes out as the actual value. I am attempting to qualify the query to the value from the recordset record the do while loop is currently at.

strSqlPhysSelect = "Select dbo_DMisProvider.ProviderID, dbo_DMisProvider.Name into tbl_IPA_Phys_Select " & _
"FROM dbo_DMisProvider " & _
" WHERE dbo_DMisProvider.ProviderID = " & rst!ProviderID &";"

Thanks

GPSPOW
 

SQL_Hell

SQL Server DBA
Local time
Today, 05:28
Joined
Dec 4, 2003
Messages
1,360
Whats the question here? all you've said is what you doing
 

jdraw

Super Moderator
Staff member
Local time
Today, 00:28
Joined
Jan 23, 2006
Messages
15,378
Please show us all the code involved. As SQL_Hell says, you haven't asked a question, so please do.
 

HCB

New member
Local time
Today, 00:28
Joined
Jul 17, 2009
Messages
7
Not the same person, but a similar issue. I am new to VBA programming in Access and am trying to use a local (Access) table/recordset to a SQL Pass thru query.
Local Table: One column (Patient_IEN) as

Patient_IEN
7175551,
23613408104,
23613413153

SQL Pass Thru Sample:

Select
a.PATIENT_#02_IEN,
a.KEY_TIU_DOCUMENT_8925
From Vista.MDE.TIU_DOCUMENT_8925 a
Where a.PATIENT_#02_IEN in(Local recordset/Table)

Any help would be appreciated.
 

Users who are viewing this thread

Top Bottom