Coldfusion query output order totals by day I have been trying to work out how to query a database with MSSQL 2012 &amp; CF 10 to output the totals of a days transactions in its own result set.  &lt;cfquery name="myquery" datasource="#mydatasource#"&gt; SELECT paid,orderTotalCost,orderTotalGST,orderID,orderCountry,orderDate,orderState FROM storeOrders WHERE paid = &lt;cfqueryparam cfsqltype="cf_sql_bit" value="#arguments.paid#"&gt; AND orderDate BETWEEN &lt;cfqueryparam cfsqltype="cf_sql_timestamp" value="#arguments.startDate#"&gt; AND &lt;cfqueryparam cfsqltype="cf_sql_timestamp" value="#arguments.endDate#"&gt; &lt;/cfquery&gt;   trying to output the data   Monday    | 100 Tuesday   | 200 Wednesday | 300 Thursday  | 400 Friday    | 500 Saturday  | 600 Sunday    | 700   My SQL Skills arent very good, so Im hoping someone on here could kindly help me out as to how to sum up the data and return it as its own column ?  thanks in advance
SQL group by day, show orders for each day I have an SQL 2005 table, let's call it Orders, in the format:  OrderID, OrderDate,  OrderAmount 1,       25/11/2008, 10 2,       25/11/2008, 2 3,       30/1002008, 5   Then I need to produce a report table showing the ordered amount on each day in the last 7 days:  Day,        OrderCount, OrderAmount 25/11/2008, 2,          12 26/11/2008, 0,          0  27/11/2008, 0,          0  28/11/2008, 0,          0 29/11/2008, 0,          0 30/11/2008, 1,          5   The SQL query that would normally produce this:  select count(*), sum(OrderAmount)     from Orders     where OrderDate&gt;getdate()-7     group by datepart(day,OrderDate)   Has a problem in that it will skip the days where there are no orders:  Day,        OrderCount, OrderAmount 25/11/2008, 2,          12 30/11/2008, 1,          5   Normally I would fix this using a tally table and outer join against rows there, but I'm really looking for a simpler or more efficient solution for this. It seems like such a common requirement for a report query that some elegant solution should be available for this already.   So: 1. Can this result be obtain from a simple query without using tally tables?  and 2. If no, can we create this tally table (reliably) on the fly (I can create a tally table using CTE but recursion stack limits me to 100 rows)?
Removal of statistically significant intercept term increases $R^2$ in linear model A geometric sequence has its first term equal to $12$ and its fourth term equal to $-96$.   How do I find the common ratio? And find the sum of the first $14$ terms GNOME has grey bar on top and bottom after upgrade from 17.04 to 17.10, how do I fix it to how it's supposed to look? This is how my desktop looks after the update, the top bar turning grey and the addition of the bottom bar happened after the update.    From my searching of screenshots this does not appear to be how it is supposed to be. Is there any way to fix it? If $\omega \in \Omega^q(M)$, and $(\omega|_{U})_p = 0$, is $\omega_p = 0$? Consider a common proof of the uncountability of $(0,1]$, as presented  for example:  We assume that the reals can be arranged in a sequence $x_k$, represent every number in $x_k$ by its nonterminating decimal expansion, use the diagonal argument to create a sequence of decimal digits that differs from the nonterminating decimal expansion of each number in $x_k$ and then claim that this sequence of digits so generated must be the decimal expansion of some number not in $x_k$.  My problem is with this last step. Could it not be the case that the new sequence of digits is just the terminating decimal expansion of some number already in $x_k$?  Would it not be more correct to use the sequence $x_k$ to generate a sequence of all (both terminating and non-terminating) decimal expansion of all numbers in $[0,1)$ and then apply the diagonal argument? UK Visa Refusal: Provenance of funds/parking I have applied recently for a general visitor visa to the UK to spend 10 days during Christmas with my British unmarried partner and it has been turned down.   The Entry Clearance Officer stated on his refusal notice the following:     I note that you have never previously travelled to the UK or any country with similar immigration requirements and you therefore do not have a history of travel and compliance to consider.      You have submitted an employment letter to confirm your occupation in KSA but I am required to also assess your personal, domestic and economic circumstances in determining whether you are genuine visitor travelling to the UK for the period and purpose you state.      You claim an income of SAR ........ per month which equal ........ GBP and from the evidence submitted this appears to be your sole source of income.   I note that this monthly income is reflected on your bank statements. However, the bank statement you have presented show a recent large deposit that are in excess of your stated income and inconsistent with the account history. You haven't provided evidence toward the origin of this recent deposit and in the absence of reasonable evidence I am not satisfied that these bank statements accurately reflect your personal circumstances.      In view of the above, I am not satisfied you have demonstrated that your circumstances are as you claim and therefore I am not satisfied that you're travelling to the UK for the period and purpose you stated. 41(i)and(ii).   Its true that I have deposited that sum of money right before I apply and it was a commission I received from work earlier this month.   So, could you please give me your advice on the above as I am planning to apply again soon. and how to avoid my application being refused again? Is there any bidirectional 5v-3.3v level shifter? Is there any IC that interfaces any 3.3V Input/Output to 5V Output/Input? I need it primarily for an Arduino Due but if there any bidirectional IC that works like that it would be great.  Some people advised me to use the SN74AHC125 and CD4050 ICs, but I don't understand how they work or how to interface with them. How do I pluralize Italian foods, like pasta noodles (spaghetti, macaroni)? Possible Duplicate:             Is it proper to say spaghettis for more than one spaghetti noodle?  What about macaronis as a plural for more than one macaroni noodle? Duplicate:                      The number of residents has grown.    The number of residents have grown.      Which of the above sentences is grammatical? Since has should stick with singular nouns and have with plural ones, I guess (2) should be correct, but I'm not sure. Make clear which profile data is visible to whom MS SQL Server: Do multiple queries in a batch ever execute in parallel and if so what happens when the second query is dependent on the first? Why am I getting rounded faces when combining Edge Split and Subsurf? What's going on here? I'm trying to apply a normal edge split with a subdivision to make it look high poly with good edges. But when I applied it on this model it did this. What is exactly the density of a black hole and how can it be calculated? Is it time for Stack Exchange, Inc and the community to legally separate amicably? Does light reflect if incident at exactly the critical angle? A lot of textbooks and exam boards claim that light incident at exactly the critical angle is transmitted along the media boundary (i.e. at right-angles to the normal), but this seems to violate the principle of reversibility in classical physics.  How would a photon or ray travelling in the reverse direction "know" when to enter the higher refracting medium?  It can't know, so I conclude that such light is simply reflected?  Is this correct? What if MSE used a different rep model for privileges? Why did the limit of power change from wizard/witch to wand? So in the first 5 or 6 books, it was very clear that the wand chooses the wizard and the power/level of the spells the wizard produces is based on the knowledge and skill of the wizard.  This is referenced by people constantly being telling Harry that he wasn't skilled enough to perform certain spells, or Bellatrix telling Harry that he needed to mean the Cruciatus curse for it to be effective.  However, in the 7th book, this entire idea is changed to the wand being the thing that's powerful and regardless of the wizard's/witch's skill or knowledge, he/she could still perform a very advanced spell if it's something the wand could handle.  Goyle accidentally creating a fire serpent is something that instantly comes to mind from the movies(I don't remember if that happened in the book).  So, my question is, what actually holds the power, the wizard/witch, or the wand? How to resolve a hostname to an IP address in Metro/WinRT? Is there a way to enter the default keyring password using the command line?   For instance:  You have a remote setup of Ubuntu 10.10 thats set to auto login. You don't want to remove  the keyring password.  All right the system boots up and logs in automatically, then asks for the keyring password now at this point you can create ssh connections but you can't remote desktop.   What can you do to enter the keyring password at this point?  Also, to better clarify, this is from a remote connection using the command line. English idiom for 'bad consequences stemming from too much ambition' I'm looking for an idiom that is equivalent to the Portuguese:  Quem tudo quer, tudo perde. Who wants everything, loses everything.  It basically points out that being too ambitious will have bad consequences: not only does one not get what one's striving for, but one also ends up losing what one already had (and probably took for granted). This idiom should be usable in everyday speech.