I have a query in which I would like the items to be returned in a certain order, starting with those having value:
ID_ObservationType=1 and then 3 and then 2.
I used to order it 1,2,3 but now the client has asked for them items to come in a different fashion. Is there a simple way to request this via SQL, so I don't have to write some fancy to solve it.
On second thougts, simpler would be
NewSort:iif(ID_ObservationType=2,20,ID_Observation Type)
3 1791
As a "Quick Fix" you could try adding a calculated field to the query
NewSort:iif(ID_ObservationType=1,1,iif(ID_Observat ionType=3,2,3))
and then sorting by that instead
Something along those lines
There is always someone who mucks up your carefully planned database :)
On second thougts, simpler would be
NewSort:iif(ID_ObservationType=2,20,ID_Observation Type)
Is IIF native SQL (I dont think it is). I would prefer to keep it in native sql if possible, for performance issues. But for now, I will go with your solution Delerna, thank you!
Sign in to post your reply or Sign up for a free account.
Similar topics
by: its me |
last post by:
Let's say I have a class of people...
Public Class People
Public Sex as String
Public Age as int
Public Name as string
end class
And I declare an array of this class...
|
by: Xah Lee |
last post by:
Sort a List
Xah Lee, 200510
In this page, we show how to sort a list in Python & Perl and also
discuss some math of sort.
To sort a list in Python, use the “sort” method. For example:
...
|
by: Steve Crawford |
last post by:
I am suffering some sort order confusion. Given a database, "foo",
with a single character(4) column of data left padded with spaces I
get:
select * from foo order by somechars;
somechars...
|
by: adrian.chandler |
last post by:
Hi all,
I have been using letter and symbol codes such as GNU< GNU\ GNU}
GNU in an Access table. I was surprised to see that when the table
was sorted on this field, the order is:
GNU...
|
by: Jan Smith |
last post by:
I've searched the overloads for the Array.Sort method, and I haven't found a
clear answer to my question. Maybe it's not in Array.Sort.
Here's the question:
I initialize an array X with the...
|
by: Patrick |
last post by:
I got a page that loads a xml file into a treeview control. I want it to
sort the data before sending it to the treeview control is that possible?
<root>
<level1 name="" src="" order="0">...
|
by: weetat.yeo |
last post by:
Hi all ,
I have sql statement below ,
SELECT
serial_no,host_name,chasis_model,chasis_flash_size,chasis_dram_size,...
|
by: wheel |
last post by:
I have already built in support for multiple languages in some of my
applications, but so far they have only used Western languages (English,
Spanish, etc). I need to add some Far East languages:...
|
by: Kc-Mass |
last post by:
In a standard Ascii table a dash or hyphen is decimal 45. A period or dot is
decimal 46.
If I sort a table or recordset of mixed character string ascending in
Access, those strings beginning with...
|
by: KevinADC |
last post by:
Purpose
The purpose of this article is to discuss the difference between characters inside a character class and outside a character class and some special characters inside a character class....
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM).
In this month's session, the creator of the excellent VBE...
|
by: MeoLessi9 |
last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
|
by: DolphinDB |
last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation.
Take...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, youll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: marcoviolo |
last post by:
Dear all,
I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
|
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...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
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...
| | |