Sorry, since its custom coding, its not really something that is supported, so you'll have to write the query on your own. It should be just a regular select query with a where clause to filter though.
I'm not sure how the passwords are encoded in ADDT, so I wouldn't be able to tell you that. There should be plenty of documentation online for SHA-1 encryption though.