473,321 Members | 1,708 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,321 software developers and data experts.

Several SQL questions

Hi all,

I'd like to know if it's possible to sort twice in a same SQL query.

I use SQL for retrieving Data into an Excel Spreadsheet.
(Excel 2000 or XP) and to paste the queries results into an Excel
spreadsheet.

1. I tried to sort by date and the only way was to use the serail number
instead of the litteral name

I tried SELECT * FROM [Sheet1$] Where [Date] <= 07/20/2003"
but this does not work.
I then tried SELECT * FROM [Sheet1$] Where [Date] <= 37822" and it
works.

Do you know a way to use 07/20/2003?

2. I need to sort my data twice, first by name and second by date. Is it
possible to sort twice in one query?
Something like:
"SELECT * FROM [Sheet1$] Where [Date] <= 07/20/2003 ORDER BY [NAME] ASC,
ORDER BY [DATE] DESC"
3. Even if the first row of my Excel sheet includes the headers, I can
not perform a query other than SELECT * FROM, for exemple, SELECT [NAME]
FROM, does not work. do you know how to do that?
Thanks in advance for sharing your experience,

Phil

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 20 '05 #1
1 3383
John Bell (jb************@hotmail.com) writes:
SELECT * FROM [Sheet1$] Where [Date] <= '07/20/2003'

Usually it is better to use a safe date format e.g. '20030720'


'20030720' is the safe format in SQL Server, but it appears that we're
talking Excel here. What is a good format for Excel, I have no idea.
'2003-07-20' appears to be a good bet, but I don't know. (It surely
will work on my computer - because that is my regional setting.)
--
Erland Sommarskog, SQL Server MVP, so****@algonet.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: michela rossi | last post by:
Hi, Don't know if anyone can help me. I've got the following questions: 1. Does anyone know of anywhere that offers shared webspace which has support for Java/JSP? Ideally running Tomcat? 2. ...
1
by: Torsten Mohr | last post by:
Hi, i'd like to write an extension module and use PyArg_ParseTuple in that to parse the parameters. I have several questions related to this that i did not find in the documentation: 1....
0
by: Victor Porton | last post by:
Suppose I create several RSS channels: http://example.com/company-news.rdf http://example.com/new-products.rdf http://example.com/product-updates.rdf etc. They are interrelated: for example,...
5
by: NotGiven | last post by:
I have a form with several questions. Within each question there are several checkboxes. I need to ensure that the user checks at least one checkbox. They can check more but must check at least...
1
by: Ayende Rahien | last post by:
I'm storing my data inside an XML file, the data is divided into several niches. I expect two things to happen during normal use of the application: A> Number of niches to grow. B> Amount of...
0
by: Chad A. Beckner | last post by:
I am starting to work on implementing ASP.NET (using VS.NET Dev 2003) into our current ASP 3.0 intranet setup. We have several (say 15 - 20) "applications" that are run within our intranet, which...
2
by: Tiago Miguel Silva | last post by:
Hi there to all. I am a .NET Crystal newbie and I hope that you don’t pick me up much :) with the following questions: 1) It’s possible to access the report model to alter the rendered...
7
by: Byron | last post by:
I have several user controls that have a few methods in common, such LoadFromForm() which populates an object from controls on the form. I want to call that method from the form in which the...
9
by: eitan | last post by:
Hello, I am using Microsoft Visual Studio 2003 .NET. I have several question, please. 1) I have a connection to the database, which I create it at login, by application("conMain") (I have...
1
by: Joe | last post by:
Dear all, I have many questions, please help! 1.) If i use the backup/restore function in the IIS, does the backup includes only the register and settings of web sites in the IIS only, or does it...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.