Help with SQL statement (File extension)

Hi, I need to create an attribute in my ProjectWise Design Environment that populates the attribute field with the file type (.dgn for example).

I cant find a way of pulling the file type out of the document properties and into an attribute file... its part of the file name but again that's not an attribute.

I was thinking I could set up an SQL that states that if MicroStation application is set then pre populate the file type attribute with .dgn. But again I cannot make the link between SQL attribution and data sitting inside a documents properties.