Solved

put the data in order with this statement

Posted on 2007-12-03
6
146 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
Comment Utility
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
Comment Utility
I get an error by the "And statement"
0
 
LVL 25

Expert Comment

by:imitchie
Comment Utility
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
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
LVL 17

Expert Comment

by:Shanmuga Sundaram
Comment Utility
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
Comment Utility
There was no error in the original SQL.
0
 
LVL 25

Accepted Solution

by:
imitchie earned 500 total points
Comment Utility
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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

772 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now