Olá
Tenho lo seguinte código:
Dim arrData(), dbs As Database, rs As Recordset, F As Integer, C As
Integer
Dim Cnn1 As ADODB.Connection
Dim RST As ADODB.Recordset
Dim StrCnn As String
Dim strCmdChange As String
Dim strQuery As String
Dim DataIn As String
Dim DataFim As String
Set Cnn1 = New ADODB.Connection
StrCnn = "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\Supervisao\Carregador.mdb;Persist Security Info=False"
Cnn1.Open StrCnn
Set RST = New ADODB.Recordset
RST.CursorLocation = adUseClient
DataIn = Format(ComboDataIn.Value, "mm-dd-yyyy")
DataFim = Format(ComboDataFim.Value, "mm-dd-yyyy")
' strQuery = "Select * From RegVag Where Data>= #" & DataIn & "# And Data
<= #" & DataFim & "# Order by Data desc"
'strQuery = "Select * From RegVag Where Data BETWEEN # " & DataIn & "#
And #" & DataFim & "# Order by Data, hora desc"
' strQuery = "Select * From RegVag Where Data BETWEEN #05/10/2001# And
#05/10/2004#"
strQuery = "Select * From RegVag Order by Data Asc"
RST.Open strQuery, Cnn1, , , adCmdText
Set Grid.DataSource = RST
O problema é que no ordena por Data.
Se coloco limites para la Data não sai
nenhuma linha na DataGrid.
Qual será o problema?
A base de dados foi contruída em Access 97.
Com esta query ordena da segunte forma:
strQuery = "Select * From RegVag Order by Data Asc" ', hora desc"
Primeiro por dia
Segundo por mês
depois por Ano
23-04-2000
23-04-2001
23-04-2002
24-01-2000
24-02-2000
24-04-2000
Cumprimentos
T.C.
Leer las respuestas