Hi TJ,
The query is executed in the context of a package and an element/object being processed for document generation, so you can use the #PACKAGEID# and #OBJECTID# macros in your query.
In a baseline's t_document row, the ElementID corresponds to the package GUID -- not actually an element GUID as you've got in your query.
The reason it works is that an EA package has a row both in t_package and in t_object, with the same ea_guid in both. This has been discussed before on this forum, and Sparx representatives have stated that that GUID matching is subject to change without notice.
But there is a more compelling reason to use t_package in your query, which is that you can create baselines on root nodes -- and root nodes do not have a t_object row. They're packages, but not elements (which is why they can't be shown in diagrams or have connectors going to them). Thus, your query won't find root node baselines.
So use t_package instead, and match t_package.Package_ID with #PACKAGEID#.
As to the second part of your question, the Notes column is text, not a timestamp. The "Baseline time:" text is simply the default in a dialog which the user may override, so you're not guaranteed to find a time there at all. Use t_document.DocDate instead.
HTH,
/Uffe