You just need to include the NSQL construct;
@WHERE:PARAM:XML:INTEGER:/data/ProjectID/@value@
in your NSQL, this will grap the ProjectID from the URL of the page you are on and you can then match that with the INV_INVESTMENTS.ID in your NSQL code.
This is documented in the Studio Developer's Guide under "NSQL / XPATH (XML Parameter) Constuct"
(Check the exact syntax in the manual and on the page you are adding the portlet to; the important bit is the "ProjectID" part because that is looking for the explicit text ProjectID=nnnnnn in the URL)