473,402 Members | 2,061 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,402 software developers and data experts.

SQL statement Order By

134 100+
HI,
I want to set the order by desc in the sql statement, but my statement cause
BOF or EOF, what wrong with the statement ?
Expand|Select|Wrap|Line Numbers
  1. rsProcess.Open "select * from Process where SN = '" & Bd_details.Controls(Bsn).Text & " ORDER BY sn, debugno desc" & "'", conn
Jul 5 '08 #1
7 2613
puppydogbuddy
1,923 Expert 1GB
Try it this way and see if it helps:
Expand|Select|Wrap|Line Numbers
  1. rsProcess.Open "select * from Process where SN = '" & Bd_details.Controls(Bsn).Text & "'" ORDER BY debugno desc" , conn 
Jul 5 '08 #2
jamesnkk
134 100+
Try it this way and see if it helps:
Expand|Select|Wrap|Line Numbers
  1. rsProcess.Open "select * from Process where SN = '" & Bd_details.Controls(Bsn).Text & "'" ORDER BY debugno desc" , conn 
Error message display "Expected End of Statement"
Jul 5 '08 #3
puppydogbuddy
1,923 Expert 1GB
Error message display "Expected End of Statement"
What part of the Sql statement was highlighted?
Jul 5 '08 #4
puppydogbuddy
1,923 Expert 1GB
What part of the Sql statement was highlighted?
My mistake....I misread the sql...try it this way:
Expand|Select|Wrap|Line Numbers
  1. rsProcess.Open "select * from Process where SN = '" & Bd_details.Controls(Bsn).Text & "'" ORDER BY sn, debugno, desc" , conn
Jul 5 '08 #5
jamesnkk
134 100+
My mistake....I misread the sql...try it this way:
Expand|Select|Wrap|Line Numbers
  1. rsProcess.Open "select * from Process where SN = '" & Bd_details.Controls(Bsn).Text & "'" ORDER BY sn, debugno, desc" , conn
I think you miss out & and the " before ORDER, I manage to get it right,
thank for the inspiration.
Expand|Select|Wrap|Line Numbers
  1. rsProcess.Open "select * from Process where SN = '" & Bd_details.Controls(Bsn).Text & "'" & "ORDER BY SN,Debugno desc", conn
Jul 5 '08 #6
puppydogbuddy
1,923 Expert 1GB
Yes, you are correct. Sometimes, it is hard to see unless you have the database to in front of you to work with. Glad you got it resolved.
Jul 5 '08 #7
NeoPa
32,556 Expert Mod 16PB
Basically, it was a matter of moving the closing quote (') for the
WHERE SN='blahBla ORDER BY ... '
...so that it comes before the ORDER BY instead of somtime afterwards. The later problems were due to missing and extra double-quotes (") - which can get confusing - especially if you're rushing.

[ CODE ] tags always help to minimise these of course ;)
Jul 8 '08 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Marian Heddesheimer | last post by:
Hi, does anybody know a good pattern for PHP regular expression (like preg_match) to split an existing SQL statement into their parts? For example, if I have this: $sql = "select field1,...
47
by: Andrey Tatarinov | last post by:
Hi. It would be great to be able to reverse usage/definition parts in haskell-way with "where" keyword. Since Python 3 would miss lambda, that would be extremly useful for creating readable...
4
by: Chad Richardson | last post by:
I've always been mistified why you can't use a column alias in the group by clause (i.e. you have to re-iterate the entire expression in the group by clause after having already done it once in the...
1
by: brett | last post by:
Here is my SQL string: "SELECT to_ordnum, to_orddate," _ & "(SELECT SUM((DDPROD.pr_stanmat * DDPROD.pr_prfact) * (DOBOM2.b2_quant * DDORD.or_quant)) FROM DDPROD INNER JOIN DOBOM2 ON...
35
by: Thomas Matthews | last post by:
Hi, My son is writing a program to move a character. He is using the numbers on the keypad to indicate the direction of movement: 7 8 9 4 5 6 1 2 3 Each number has a direction except...
18
by: war_wheelan | last post by:
I am very new to Transact-SQL programming and don't have a programming background and was hoping that someone could point me in the right direction. I have a SELECT statement SELECT FIXID,...
2
by: serge | last post by:
/* This is a long post. You can paste the whole message in the SQL Query Analyzer. I have a scenario where there are records with values pointing to wrong records and I need to fix them using an...
2
by: Edward S | last post by:
I would appreciate if someone could correct my SQL statement which is displaying a message Expected : End of Statement this statment is attached to a button on the form StrSQL = "PARAMETERS !!...
2
by: robert kurz | last post by:
hallo ng, i am trying to parse a sql-statement with regular expressions. my goal is to get the parts of the statement. in my thoughts the group-functionality of the regular expressions should do...
5
by: Brian Tkatch | last post by:
Is there a way to do ORDER BY with DESC inside a CASE statement? That is, given more than one choice for an ORDER BY based on a CASE statement, but only one of the choices will also use DESC...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.