im trying to figure out how to properly use a select query in vb.net. The query im trying to use uses a join function, to join multiple tables. I also have a where filter in there. Below is the query as it works in MS SQL Server Management Studio. Can anyone here push me in to the right direction or know of a syntax/format I can use to perform this query?
select th.*, odo.OptionCode from FVMASTER..trackinghistory th join FVMASTER..OrderDetailOptions odo on odo.odKey=th.odKey join FVMASTER..MasterPartOptions mpo on mpo.Code=odo.OptionCode and mpo. [Group]=odo.optiongroup and mpo.QuestionKey='KGLASS' and OptionType=5 where th.DateTime>DATEADD(DAY,-4,getdate()) and th.Code='__A__' and th.StationID='HO4' and left(odo.OptionCode,1) = 'H' order by th.SchedID, th.UnitID, th.MasterKey