× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Sorting is done by ORDER BY clause and in your case, depending on the data
type, something like this might work: ORDER BY SUBSTR(CHAR(myDateField),1,2)
DESC

To do totals you'd use SUM aggregate function.  Since you imply that you'll
be doing it per warehouse, you may need to group your results based on
warehouse:  GROUP BY WAREHOUSE

With some data samples and a more detailed description of the actual output
desired we might be able to give you the actual statement to run.

BTW, since you're a newbie let me just say that interactive SQL is good
place to start experimenting with SELECT statements.  Invoke STRSQL command,
type SELECT and hit F4 for prompt and let it guide you rest of the way.
Good luck.

Elvis

-----Original Message-----
Subject: SQL Newbie question

I need to take 2 files, one is the Frieght, and the other is Order detail,
which has the real amt paid for frt. To sort by year where the format is
mmddyy. I would like to do this in SQL. I am not sure how to flex out the
year and sort on it, how to total various warehouses and other codes.

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.