Hi,
I am not sure If I am looking at this the right way. I want to get the highest number of the field "closecot" of qryCotacoes, considering only the n last entered records, in this case n would be a parameter.
I understand that in a select query I would set field parameters with :
but how can I set programaticaly the top value parameter , wich is this case is 30 to a variable ?
I would appreciate your help
I am not sure If I am looking at this the right way. I want to get the highest number of the field "closecot" of qryCotacoes, considering only the n last entered records, in this case n would be a parameter.
I understand that in a select query I would set field parameters with :
Code:
n=30
Set MyQryDef = db.QueryDefs("qryCotacoes")
MyQryDef.Parameters("Parameter1").Value = n
but how can I set programaticaly the top value parameter , wich is this case is 30 to a variable ?
Code:
SELECT TOP 30 *
FROM tblCotacoes
ORDER BY tblCotacoes.cotacaoid DESC;
I would appreciate your help