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

Order by - testing on true/false

1
Afternoon all

I'm trying to write a query thats orders data in a specific way, depending on specific rows in the database...

Basically, the application pulls data from a Customer Management database, and displays a list of 'outstanding calls' relevant to what group you're in. Currently, its set to order all calls by the amount of time left to complete the work before the call 'breaches' (ie, passes the time set out in our service standards). HOWEVER, Ive now been asked to ensure that all priority 1 calls are listed first, regardless of any other outstanding calls.

So, for arguements sake, lets say the query is this:

Expand|Select|Wrap|Line Numbers
  1. SELECT callId, callSubject, callNote, callBreachDate, callPriority
  2. FROM tblCall
  3. WHERE callCompleted = False
  4. ORDER BY callBreachDate
This pulls all calls through in a nice order, showing the call with the least time left to be completed at the top.
Ideally - all within a single SQL query (if possible) - I'd like to:

1st: order by priority 1 calls first (ie, WHERE callPriority = 1)
2nd: order whats left by callBreachDate

However, simply sorting by callPriority won't work, as theres some special calls that are logged as priority 0, so 1 isnt the 'lowest number' (so to speak).

Any help with this would be much appreciated. If any further clarification is needed, let me know!!!
Feb 13 '07 #1
0 1644

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

Similar topics

7
by: svilen | last post by:
hello again. i'm now into using python instead of another language(s) for describing structures of data, including names, structure, type-checks, conversions, value-validations, metadata etc....
9
by: copx | last post by:
I wonder if something like this would be save/portable: m = find_slot(); if (m != NOT_FOUND && list.state == OK) { ... The question is: Is it guaranteed that the "list.state == OK" check...
25
by: tienlx | last post by:
Hi all, i'm sorry about my poor English ( it isn't my native language). I confused the order which the function in C be evaluted in for() function ? Ex: i have 3 functions : a() b() and c() and...
5
by: Brian | last post by:
Hello all.. Am working on an Air Hockey game... have an table loaded into a picture box. The borders of the table are slightly slanted. Am using hit testing lines with GDI+ to manipulate the...
16
by: mdh | last post by:
May I ask the group the following: (Again, alas , from K&R) This is part of a function: while ( ( array1 = array2 ) != '\0' ); /* etc etc */ Is this the order that this is evaluated? ...
6
by: Index | last post by:
Hi, I have a file which I want to sort depending on multiple columns. Actually I want to implement the following query through programming: SELECT SUM(VALUES) GROUP BY x,y ORDER BY x,y; the...
1
by: aRTx | last post by:
<? /* Directory Listing Script - Version 2 ==================================== Script Author: Artani <artan_p@msn.com>. www.artxcenter.com REQUIREMENTS ============ This script requires...
1
by: Brit | last post by:
I have an ASP file that retrieves names from an Access database for 4 different categories of membership, which the visitor to the page selects (corporate, institutional, regular, or student). The...
11
by: VK | last post by:
In the continuation of the discussion at "Making Site Opaque -- This Strategy Feasible?" and my comment at http://groups.google.com/group/comp.lang.javascript/msg/b515a4408680e8e2 I have...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
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...

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.