al4629740
asked on
put the data in order with this statement
I want to put this data in order by name in vb6. How do I do this?
esql = "select * From frmRegistrationCSW Where frmRegistrationCSWCheck3 = 1 And frmRegistrationCSWCheck10 =1 And frmRegistrationCSWText15 >= convert( datetime, " & ravi & BeginDate & ravi & " , 101 )And frmRegistrationCSWText15 <= convert( datetime, " & ravi & EndDate & ravi & " , 101 ) "
esql = "select * From frmRegistrationCSW Where frmRegistrationCSWCheck3 = 1 And frmRegistrationCSWCheck10 =1 And frmRegistrationCSWText15 >= convert( datetime, " & ravi & BeginDate & ravi & " , 101 )And frmRegistrationCSWText15 <= convert( datetime, " & ravi & EndDate & ravi & " , 101 ) "
esql = "select * From frmRegistrationCSW Where frmRegistrationCSWCheck3 = 1 And frmRegistrationCSWCheck10 =1 And frmRegistrationCSWText15 >= convert( datetime, " & ravi & BeginDate & ravi & " , 101 )And frmRegistrationCSWText15 <= convert( datetime, " & ravi & EndDate & ravi & " , 101 ) ORDER BY NAME"
ASKER
I get an error by the "And statement"
interesting, you had an error in the original SQL
esql = "select * From frmRegistrationCSW Where frmRegistrationCSWCheck3 = 1 And frmRegistrationCSWCheck10 =1 And frmRegistrationCSWText15 >= convert( datetime, " & ravi & BeginDate & ravi & " , 101) And frmRegistrationCSWText15 <= convert( datetime, " & ravi & EndDate & ravi & " , 101 ) ORDER BY NAME"
esql = "select * From frmRegistrationCSW Where frmRegistrationCSWCheck3 = 1 And frmRegistrationCSWCheck10 =1 And frmRegistrationCSWText15 >= convert( datetime, " & ravi & BeginDate & ravi & " , 101) And frmRegistrationCSWText15 <= convert( datetime, " & ravi & EndDate & ravi & " , 101 ) ORDER BY NAME"
If not try like this
esql = "select * From frmRegistrationCSW Where (frmRegistrationCSWCheck3 = 1 And frmRegistrationCSWCheck10 =1) And (frmRegistrationCSWText15 >= convert( datetime, " & ravi & BeginDate & ravi & " , 101) And frmRegistrationCSWText15 <= convert( datetime, " & ravi & EndDate & ravi & " , 101 )) ORDER BY NAME"
esql = "select * From frmRegistrationCSW Where (frmRegistrationCSWCheck3 = 1 And frmRegistrationCSWCheck10 =1) And (frmRegistrationCSWText15 >= convert( datetime, " & ravi & BeginDate & ravi & " , 101) And frmRegistrationCSWText15 <= convert( datetime, " & ravi & EndDate & ravi & " , 101 )) ORDER BY NAME"
ASKER
There was no error in the original SQL.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.