SQL statement in a VB Script

josh2009

Member
Joined
Sep 16, 2009
Messages
14
Programming Experience
Beginner
I have a SQL statement in my VB script to get info from different tables based on a variable that I am using in my script. It works exactly how I want it to work except that now I need to add another condition in my where clause. I can run the SQL statement in SQL Server Management Studio and get my information with the additional condition but syntax especially using quotes in a VB script is very confusing for me. Here is my script -

ssql1 = "select c.item,e.vesselsegment, e.prestenosis, e.poststenosis, e.preTIMIFlow, e.postTIMIFlow
from demographics a
inner join event_cath b on a.ss_patient_id = b. ss_patient_id
inner join cath_equipment c on b.ss_event_cath_id = c.ss_event_cath_id inner join cath_extension d on b.ss_event_cath_id = d.ss_event_cath_id inner join lesions e on b.ss_event_cath_id = e.ss_event_cath_id
where c.lesion1 = e.vesselsegment and b.ss_event_cath_id = " & currentCathRecord("SS_Event_Cath_ID")

As I had mentioned I would like to add the condition c.lesion1 = currentLesionRecord("VesselSegment") to my where clause but I am very confused with all the single and double quotes in a VB script

Any help will be greatly appreciated. Thanks
 
josh2009, FYI VB.Net is not a scripting language, it is a compiled language. VBScript is a scripting language, and is often referred to as "VB script". VBScript is not supported at VB.Net Forums. To avoid confusion I suggest that you stop referring to VB.Net as "VB script" as of right now.
 
Back
Top