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 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...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 ...Cannot open Excel attachments
Hello, I have a user that cannot open Excel attachments from inside Outlook.
He gets a security message and is given an option to save the attachments or
cancel. He can open all other attachments without this warning appearing. I
checked his registry and he has .xls files in the exception that is posted
on the MS KB. He has Excel 2002 and Outlook 2002. His e-mail comes through
an Exchange server. I do not have special security settings in place for
this user. I cannot find anything else on Google or MS. Please help. Thank
Aaron hu kiteb:
> Hello, I have a user that cannot op...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...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...looking for Excel VBA work
I am looking for Excel VBA work... I have been working with excel and
vba for the past 3 years. I am very involved in it. I love helping
people. Although I do require some money for my work, I do not charge
as high as most programmer's do. If you need some help or some work
done, please contact me at
conspiringfate's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=31745
View this thread: http://www.excelforum.com/showthread.php?...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?
...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
...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...How do I set up my expense/income statement in excel?
...Excel charts won't appear or preview. Help!
In Excell 2003 I cannot get my charts or graphs to appear or preview. I was
able too at first. But I accidentally hit right click and then clear several
times after having created template line chart for the first time. This
subsequently one at a time removed different aspects of my chart until my
chart was gone. And now i cannot get the charts to appear again. Not even a
preview. Thank you in advance foe your help and advice.
This problim has been solved. Thank you.
Someone showed me an if statement, which was not working. The cells to
which it referred were all formatted correctly (currency / accountancy) yet
the statement returned an error. I deleted the cells in the logical test
and re-entered them...I did not change the formatting, and this time it
worked. To the best of my knowledge currency signs, commas etc were not
entered manually but via cell formatting. Anyone met this before?
Perhaps you could post the formula in question.
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www...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
>...How do I format the tabs of a worksheet in Excel?
I am wondering if there is way to change the font size, font color, or tab
color so it is easier to keep my sheets straight. I dont really want to make
a table of contents or anything like that, I just need certain sheets to
stand out more than others.
If you have Excel 02, you can change the colors by right clicking on the
tabs, If your version is earlier, you are out of luck
> I am wondering if there is way to change the font size, font color, or tab
> color so it is easier to keep my sheets straight. I dont really want to make
> a table of...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...Receiving excel files
Whenever I receive an Excel file through email and try to
open it, I receive the error message 'file format is not
valid'. These are all .xls files. Any suggestions on how
to fix this problem ???
What versions of XL? (if you have versions before 97 and you are sent 97 or
above, the file formats are different)
"Doug" <email@example.com> wrote in message
> Whenever I receive an Excel file through email and try to
> open it, I receive the...macro in excel to copy from excel to word
i have a database in excel...which i would like to take more advantag
I also have some forms in Word that I was hoping to be able to get the
to be automatically completed using the excel database.
Initially thought this would be quite simple.... just record the macr
then modify it to suit.
This using simple copy from excel and paste into word document, o
pasting into form..field..values.
I have done a little before with excel macros - to a level of 'usin
excel programming for dummies' book. But really do not know where t
Have seen this:
"Dim appWD As Word.Appl...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...difference between Excel 2000 and Excel XP, and Excel 2002
I would like to know what the differences are between Excel 2000 and Excel XP, and Excel 2002
Go to John Walkenbach's site www.j-wal.com
Lots of info there.
remove CAPS in e-mail address
"Eleanor" <email@example.com> wrote in message
> I would like to know what the differences are between Excel 2000 and Excel
XP, and Excel 2002
This is a multi-part message in MIME format.
Content-Type: multipart/alt...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...Excel date problems
Our company uses a report writer/formatter that creates Excel
spreadsheets and then sends them as email attachments to specified
users. The data being formatted is coming from a file shipped to the
report software from an I5 environment.
The data coming in is in the format mmddyyyy but some of the cells in
the SS are being converted to ddmmyyyy.
When this problem occurs it only happens for months 10, 11, and 12.
These dates are being used in calculations so this is a big problem.
We are using Excel 2003.
...date formatting a cell
When I use the date formatting in a cell i.e. m/d/yy and enter my numbers i.e 2604, I get 2/16/07. Can you help me
you have to enter the date with delimiters. so you have to enter 2/6/04
If you want Excel to automatic convert numbers you have to use VBA.
Have a look at
for an example event procedure
> When I use the date formatting in a cell i.e. m/d/yy and enter my
> numbers i.e 2604, I get 2/16/07. Can you help me
that is the way Excel handles date inputs. As Excel stores dates
internally as numbers it does ...Save Excel 2002 to be read by MacIntosh Excel 2004?
Is it possible for the MacIntosh Excel 2004 to read an Excel XP 2002
spreadsheet? How should XP spreadsheet be saved? HELP, please!!
MacXL98/01/v.X/2004 files are the exact same format as WinXL97/00/02/03
files. Save the file as an XL workbook and transfer it to the Mac.
In article <0D5EBD4E-E12F-4E2D-AC2C-F45E556284E9@microsoft.com>,
"cagedbirdflies" <firstname.lastname@example.org> wrote:
> Is it possible for the MacIntosh Excel 2004 to read an Excel XP 2002
> spreadsheet? How should XP spreadsheet be saved? HELP, please!!
"JE McGimpse...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.