I'm a little confused about the use of did and had in past tense -- recent past and distant past.
For example, If I want to ask a friend whether he applied for a job (today), I would simply ask "Did you apply for the job?"
Similarly, if I want to ask him whether he had applied for the job that day (a day in the past) -- without having to mention that day -- I'd probably say "Had you applied for the job [that day]?"
Is this second sentence correct? If not, please help with the sentence construction in this context.