I have this SQL code that works perfect in SQL Management Studio:
select * from orders
join isassigned on (Orders.Orders_SysID = isassigned.ORDERS_ID)
join Assignment_ on (isassigned.ASSIGNMENT_ID = Assignment_.Assignment_SysID)
where Assignment_.AssignedTo = ‘Rick’
I place it into this embed point: Reset Procedure(BYTE Locate), Virtual as:
SELF.Open()
SELF.View{ PROP:SQL } = '(select o.catalognumber, o.compound_name, o.purchaseordernumber, ’ & |
'o.customercode, o.institution, o.datepromised, o.group_, o.quotenumber, o.attention, ’ & |
'o.invoicenumber, o.dateshipped from orders o ’ & |
'join isassigned on (o.Orders_SysID = isassigned.ORDERS_ID) ’ & |
'join Assignment_ on (isassigned.ASSIGNMENT_ID = Assignment_.Assignment_SysID) ’ & |
‘where Assignment_.AssignedTo = ‘‘Rick’’)’
IF ERRORCODE()
SELF.Primary.Me.Throw(Msg:ViewOpenFailed)
END
RETURN
PARENT.Reset!(Locate)
The format of this code is from this thread:
I have ordered the fields in the SQL syntax according to the order in the database.
I’m still getting one error: “Error: ( (01S01)) attempting to access a record from the dbo.Orders file. Returning to previous window.” Followed by: “Error ( (0) attempting to open curent VIEW. Filter and Range Limits ignored”. Followed by the same error as the first, then closes the browse.
I’m still searching, but any help would be appreciated.
Thanks.