Solved

put the data in order with this statement

Posted on 2007-12-03
6
148 Views
Last Modified: 2010-04-30
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 ) "
0
Comment
Question by:al4629740
  • 3
  • 2
6 Comments
 
LVL 25

Expert Comment

by:imitchie
ID: 20400843
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"
0
 

Author Comment

by:al4629740
ID: 20401001
I get an error by the "And statement"
0
 
LVL 25

Expert Comment

by:imitchie
ID: 20401276
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"
0
Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

 
LVL 17

Expert Comment

by:Shanmuga Sundaram
ID: 20401954
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"
0
 

Author Comment

by:al4629740
ID: 20403506
There was no error in the original SQL.
0
 
LVL 25

Accepted Solution

by:
imitchie earned 500 total points
ID: 20404941
I thought it's due to the lack of space between ) and frmRegis...
i.e.  101)And frmRegistrationCSWText15
in the original. If not, then you must be using Access

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"
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

792 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question