Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Community Discussions (All other subjects)
 Order by sum in SQL ??? (Access)
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

Jóhannes
Junior Member

Iceland
139 Posts

Posted - 27 April 2004 :  13:16:59  Show Profile  Visit Jóhannes's Homepage  Send Jóhannes an AOL message
Hi

I have a Access DB and in one table I have 5 fields, called: Par01, Par02, Par03, Par04 and Par05.

I want to make a SQL-query and order it by the sum of thouse 5 fields. How do I do that?

Jóhannes

gerardW
Starting Member

Mexico
13 Posts

Posted - 27 April 2004 :  16:36:05  Show Profile
Somthing like this?

SELECT id, par01+par02+par03+par04+par05
FROM tabel1
ORDER BY 2;

order by 2 means to sort on the second field of the fieldlist of the select-part.
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 27 April 2004 :  16:39:49  Show Profile  Send ruirib a Yahoo! Message

SELECT Par01 + Par02 + Par03 + Par04 + Par05 As Total FROM... Order By (Par01 + Par02 + Par03 + Par04 + Par05)


Snitz 3.4 Readme | Like the support? Support Snitz too
Go to Top of Page

Jóhannes
Junior Member

Iceland
139 Posts

Posted - 28 April 2004 :  03:52:10  Show Profile  Visit Jóhannes's Homepage  Send Jóhannes an AOL message
Thanks rurib !

Jóhannes

Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 28 April 2004 :  05:40:41  Show Profile  Send ruirib a Yahoo! Message
You're welcome.


Snitz 3.4 Readme | Like the support? Support Snitz too
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.39 seconds. Powered By: Snitz Forums 2000 Version 3.4.07