Re: quick simple question
- From: Stefan Hoffmann <stefan.hoffmann@xxxxxxxxxx>
- Date: Thu, 13 Jul 2006 16:35:06 +0200
hi,
ifoundgoldbug@xxxxxxxxx wrote:
but how do can I access just the first record of field LastEmail usingGuess you have table PM(ID, ..., LastSent:Date/Time).
code?
Dim rs As ADODB.Recordset
Set rs = New ADODB.Recordset
rs.Open "SELECT TOP 1 * FROM PM ORDER BY ID ASC", _
CurrentProject.Connection, adOpenForwardOnly, adLockOptimistic
Debug.? rs![LastSent]
rs.Close
Set rs = Nothing
or
rs.Open "SELECT * FROM PM " & _
"WHERE (Date()-LastSent)>6 " & _
"AND DatePart('w', ExecutionDate) = DatePart('w', Date())", _
CurrentProject.Connection, adOpenDynamic, adLockOptimistic
Do While Not rs.Eof
'....
rs![LastSent] = Date()
rs.Update
rs.MoveNext
Loop
rs.Close
mfG
--> stefan <--
.
- References:
- quick simple question
- From: ifoundgoldbug
- Re: quick simple question
- From: Stefan Hoffmann
- Re: quick simple question
- From: ifoundgoldbug
- quick simple question
- Prev by Date: accessing specific record
- Next by Date: Re: cannot update field error box
- Previous by thread: Re: quick simple question
- Next by thread: Re: Link a text box to a combo box control
- Index(es):