I created the following function in SQL, how can I assign to a control in a Datasheet form in my Access project to get the returning value of this function?
I am trying the following and getting a #Name?
P.S. In case you how to optimize this function, I would appreciate that too..
CREATE FUNCTION [dbo].[fnOrientLastNoteID]
@Orientationid AS int
DECLARE @Result AS int
select @Result = MAX(ID)
where OrientationID = @OrientationID
GROUP BY OrientationID