Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL-command with dates not working
Message
 
To
All
General information
Forum:
Visual Basic
Category:
Database DAO/RDO/ODBC/ADO
Title:
SQL-command with dates not working
Miscellaneous
Thread ID:
00466418
Message ID:
00466418
Views:
40
I can not get the following Open-command to return a recordset that has
records only which is greater than "sqlDatumFrom". It's simply returning rercords
without concern of date. Can anyone tell me what's wrong.

Using VB6.0 with ADO and VFP ODBC.


sqlDatumFrom = CDate(txtDateFrom.Text)

If cboSort.Text = "Isolator" Then
lcSort = "article"
ElseIf cboSort.Text = "Löpnummer" Then
lcSort = "sernumber"
ElseIf cboSort.Text = "Datum" Then
lcSort = "date"
End If

sqlString = "Select * from isolator where article LIKE ' " & Trim(txtIsolator.Text) & "%'" & " AND sernumber LIKE ' " & Trim(txtSerNumber.Text) & "%' " _
& " AND Date > " & "{" & sqlDatumFrom & "}" & " ORDER BY " & lcSort

DataEnv.Recordsets("rdsSparade").Open (sqlString)

/Torgny
/Torgny
Next
Reply
Map
View

Click here to load this message in the networking platform