is it possible to use variable for sorting?
declare @sort varchar(10)
SET @sort='column1 DESC'
SELECT ROW_NUMBER() OVER (ORDER BY @sort)AS rowId, * FROM table
Is dynamic SQL only option?
On 15/04/2010 11:28, simon wrote:
> is it possible to use variable for sorting?
> Something like:
> declare @sort varchar(10)
> SET @sort='column1 DESC'
> SELECT ROW_NUMBER() OVER (ORDER BY @sort)AS rowId, * FROM table
> Is dynamic SQL only option?
You can use CASE to he...How to sort account list?
I'm using MS Money 2004 Small Business. In the account list, my accounts
are catagorized by and in this order:
- bank accounts
- credit accounts
- investment accounts
- loans and liabilities
- asset accounts
In the above view, I cannot easily determine totals for assets and
liabilities. The following view does this.
- bank accounts
- investment accounts
- asset accounts
-loans and liabilities
How do I get the above view?
I don't use Small Business. But you can run a Net Worth report to get total
assets and ...How to Merge Date from 3 columns to 1
I have a spreadsheet where the date is spread over 3 columns I,J & K and I
wish to merge them to Column B in the format dd-mmm-yyyy as shown below.
B I J K
02-Feb-2003 02 Feb 2003
27-Mar-1999 27 Mar 1999
01-Apr-1978 Apr 1978
14-Jun-2002 14 Jun 2002
Where there is a blank for the day in 'Column I' I need it to copy as 01 and
where there is a blank for the month in 'Column J' I need it to copy as Jan.
Where all 3 column...Where's the Sort by New Message option?
Not sure when the layout of the newsgroups changed but I can't seem to find the ability to sort by new message in a thread instead of sorting by just the original thread date.
That was hugely helpful as I could follow along and see what threads were still active.
If you're gonna hang around in the newsgroups (any newsgroups), you may want to
start using a newsreader.
Microsoft Outlook Express can do it for you.
Saved from a previous post:
You may want to connect to the ms newsserver directly:
If you have Outlook Express installed, try clicking on these links (or copy and
paste i...Macro filter on query
I need to run 8 append and update queries using the same date range. I
created a Form with the "Month" field as the filter and a command button to
run the macro to run the Append & Update queries for records in the month
range. I can't get the Apply Filter macro to work on the Query Date field.
Apply Filter action will not do what you seek.
Your queries must have a WHERE clause that refers in some way to the textbox
on the form where you've entered the Month value/data that you want to use
in the queries.
To assist you further, you need to post ...Row names will not move with sort
Each row in my summary table in Sheet1 is hyperlinked to a corresponding table in Sheet2 with additional details.
I need to move the rows in my summary table (Sheet1) and preserve the links to and from the details tables (Sheet2).
I found that I can move rows in Sheet1 with cut & insert and the hyperlinks are maintained. I can travel from a row in summary table (Sheet1) to details table (Sheet2) and back, even after the corresponding row (Sheet1) was moved.
But if I sort the rows in Sheet1 the links from Sheet2 back to corresponding rows in Sheet1 lead to presorted locations. Apparen...formula to update todays date in excell automatically daily
formula to update todays date in excell automatically daily
=NOW() or =TODAY()
Microsoft MVP - Excel, 10 Years
Pearson Software Consulting
(email on the web site)
"Vishal" <Vishal@discussions.microsoft.com> wrote in message
> formula to update todays date in excell automatically daily
...Microsoft Query criteria syntax for date() or today()
Essentially, I need MS Query syntax for a calculation
based on today's date. I'm using Microsoft Query from
inside Excel to extract data from an ODBC database. I
want to download everything with a date of, say, in the
last 60 days. I can't find any documentation for
Microsoft Query and its Help doesn't seem to address
this. I've tried Excel and Access systax such as >Date()-
60 and =Today()-60. I've tried copying in the SQL text
created by Access. I don't know how to say "Today"
or "Now" or "Date". Any help out there?
...Rules and filters.txt
1) If filters.txt is really just a readme file to demo what Outlook is
doing, where are the actual entries stored in Outlook 2002 ? In a text
file, like "Junk Senders.txt" ? Or the Registry ? I can see it is the
outlfltr.dat for 2003. But where is it in Outlook 2002 ?
2) These 3 rules fall into 2 Types:
- Content: Adult Content Rule, Junk E-Mail Rule
- Exceptions: Exception List
I'm having difficulty interpreting the implementation of the "Exceptions
List" rule. If it represents the exceptions to who or what may use junk or
adult criteria, th...sorts not sorting
OK- Thanks to everyones help I now i have a list i can work with... but
there are a few problems.... the zips are all 5 digit and now i have to
sort them... the problem is, THEY WONT SORT CORRECTLY!!!!!!! The
numbers are not in order... some are but a lot are not... is there
anyway to fix this???? i need to sort them by zip code but cant seem to
get them to do it correctly.. any ideas???
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/
You are going to be far better of...Highlight date nearest to TODAY()
I have dates in a column in this format :
I'm trying to set the conditional formatting so that the nearest date to
today is in bold.
Can someone help with this?
Grateful for any advice.
If these were your dates:
And today was 16/3/2010
Which is the nearest date?
Microsoft Excel MVP
"Colin Hayes" <Colin@chayes.demon.co.uk> wrote in message
>...Cannot remove Intelligent Message Filter Ver 1 to install EX2K3-Sp2
This is a multi-part message in MIME format.
When trying to install SP2 on Exchange 2003, I got the flag that I =
needed to remove the Intelligent Message Filter before preceeding, no =
problem says I. However, on inspection there is no uninstall. On =
running setup from the Intelligent Message Filter install, in hopes to =
uninstall it from there, I get an unexpected error - code 2755, which =
probably means that it found that it was alread...import- number- sort?
I imported this data into a spread sheet- I tried to format it to number,
but when I sort it- I get :
Whats up with this?
Install the TrimAll macro, select the column and invoke
the macro from Alt+F8
Directions to install and use a macro at
I expect that you have spaces or CHAR(128) "Required Blank"
characters in you data you can check is =LEN(A1)
David...date formula #2
Hi i am trying for a way to work out how i can formulate the date, ie.
if today is 17 November 2003, i want to import data from date 1
Novemeber 2003 how would i do this and what formulae would i use?
~~ Message posted from http://www.ExcelTip.com
~~View and post usenet messages directly from http://www.ExcelForum.com
"jaggosai" <firstname.lastname@example.org> wrote in message
> Hi i am trying for a way to work out how i can formulate the dat...multi criteria filter
If i want to filter a single column to only show A G, J, and P ( i choose
these letters as they cant be lumped together as a range) how would i do
that in a maro or VB
Any tips appreciated
You could do it using Data|Advanced filter using a criteria range.
Record a macro when you do it once and you'll have the code.
Debra Dalgleish has some tips for working with Advanced Filter here:
Another option would be to use a helper column that contains formulas that
return true/false and then filter that column to show the ...sorting macro #3
I need to sort on 8 cells in a row and on 1500+rows. I can do it one at a
time but I know there must be an easier way. Can ANYONE HELP?
C3:J3 I need these cells sorted and then down to C1532:J1532
I did create a macro to sort after I selected them but still one at a time.
Does it have to be a macro? I can edit a macro but don't really know how to
Yes, it has to be a macro. The following should do it. This macro loops
through all the entries in Column C, and in each row it sorts the values in
Columns C:J. HTH Otto
Dim rColC As Range
Dim i As...Sorting checking register
How do i sort my check register in Money 2004 Deluxe so
that uncleared transactions appear below cleared
transactions? In Quicken i could click on the column to
provide that sort.
In microsoft.public.money, Dean wrote:
>How do i sort my check register in Money 2004 Deluxe so
>that uncleared transactions appear below cleared
>transactions? In Quicken i could click on the column to
>provide that sort.
You don't. Available choices are chosen by clicking View at the top
of the register.
...sum if and between dates
I am trying to sum information based on the following conditions
Cell E3 = Sum if = *Account A* and between *>= 20/6/05 and <=24/6/05*
The Answer would be 279
A B C D
1 19/06/2005 Account A 125 20/06/2005
2 20/06/2005 Account A 150 24/06/2005
3 21/06/2005 Account B 156 Account A
4 22/06/2005 Account B 135
5 23/06/2005 Account C 142
6 24/06/2005 Account A 129
7 25/06/2005 Account C 200
8 26/06/2005 Account A 300
---------------------------------------------------...Can we sort a form and also be able to enter new records.
It is possible to sort the data on a form and also be able to enter
new and edit the existing records in it.
On Tue, 15 Jan 2008 15:41:16 -0800 (PST), Rex wrote:
> It is possible to sort the data on a form and also be able to enter
> new and edit the existing records in it.
I assume you mean "Is it".
The form sort order has nothing to do with editing or adding new
records, so the answer is yes.
If you cannot edit or add new records, make sure the form's record
source, if it is a query, is updateable. Some queries are not.
O...using addrress books to sort incoming mail
I use address books to sort incoming mail.
An odd thing: depending on how the sender's name comes across, it doesn't
get caught by the filter (amd moved to the "Family Mail" Folder I have set
up. for example: my mom and dad's email (from email@example.com)
comes as from that address. However, in my contacts, they are listed by
their names: John and Mary Smith, with firstname.lastname@example.org as their
email address and John and Mary Smith as the display name.
What have I done wrong?
1. The big ONE - failed to post your version of Outlook. Rules operate at
...Unmerge so I can sort
I coy/pasted data into Excell and when I try to sort it I get "This operation
requires merged sells to be identically sized". I understadn the work around
in KB but how do I find which sells are merged?
I wouldn't bother looking.
I'd just remove all the merged cells from the range to sort.
Select that range
uncheck the merge cells box
But if you wanted to search, you can do it via process of elimination. Select a
range, format|cells|alignment tab.
If that merge cells box is checked, then the whole selection is merged. If it's
grey, t...Enhancement for capitalizing dates
Why not allow the user to display months and weekdays in all uppercase
(caps) by typing the format abbreviations in uppercase (caps)?
For example, MMM or MMMM or DDD or DDDD in any date format would display the
text months and weekdays in uppercase. This straight-forward convention is
used in other programs and, in fact, is even used for displaying a.m./p.m.
(lowercase) or A.M./P.M. (uppercase) in Excel by capitalizing the format
abbreviations for time.
This seems like a no brainer . . .
Blue Max wrote:
> Why not allow the user to display months and weekdays in all uppercase
When a range of columns are highlighted and a sort is performed on only one
column empty cells above the sort display first. How can this be prevented.
I know when there is data in any of the other column but not on the column
being sorted this will happen.
Are you sure the cells are really empty?
They don't contain spaces or even formulas that evaluate to "". (Even formulas
converted to values that returned "")?
> When a range of columns are highlighted and a sort is performed on only one
> column em...Sort not sorting all rows
I'm using Excel 2000. have created a document, uploaded it to google docs
and spreadsheets, exported it as a doc, converted it to a spreadsheet (excel)
and uploaded it again to google docs. It's not a complicated file - no
calculations or anything, just a simple log to enable us to collaborate on
change requests and website faults. New requests are assigned a number
incrementally one higher than the previous. So we need to sort on the Log
number column to see what the last logged number was. However, it sorts most
of the spreadsheet and leaves the same 5 rows unsorted at the...Aged Trial Balance as on a particular Date
When I print the Aged Trial Balance report in purchase module as on a
particular date, it does not filter the transactions, instead it shows up
transactions beyond the filtered date. Both the document date and posting
date of the transactions getting displayed are after the filtered date.
For example, I give 31-12-2008 as the date in the "Pint / Age as of: Enter
The report output shows up transactions with Document Date and Posting Date
Can anyone tell me what could be the reason?
Thanks & Regards,
You need to us...