General information
Category:
Database DAO/RDO/ODBC/ADO
This is how I usually do it:
Private Sub cmdGo_Click()
Dim rsContractDetailInfo As ADODB.Recordset
Set rsContractDetailInfo = New ADODB.Recordset
Dim sql as string
sql = "SELECT Contract_Number, Creation_Date, Origin_Code, Destination_Code, Species_Code, Product_Code, Zone, " & _
" Min(Begin_Date) AS MinOfBegin_Date, Max(End_Date) AS MaxOfEnd_Date, Min(Rate_Begin_Date) as MinOfRateBegin_Date, Max(Rate_End_Date) as MaxOfRateEnd_Date " & _
" FROM CONTRACT_DETAIL " & _
" GROUP BY Contract_Number, Creation_Date, Origin_Code, Destination_Code, Species_Code, Product_Code, Zone " & _
" Having CONTRACT_NUMBER = 'AH999' And CREATION_DATE = #" & Format("5/14/2001 9:58:41 AM", "mm/dd/yyyy hh:mm:ss") & "# "
rsContractDetailInfo.open sql, conn, adOpenDynamic, adLockPessimistic, adCmdText
End Sub
Just a suggestion!
Nichole Brelje
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only