AllExperts > Experts 
Search      

Database Programming

Volunteer
Answers to thousands of questions
 Home · More Questions · Answer Library  · Encyclopedia ·
More Database Programming Answers
Question Library

Ask a question about Database Programming
Volunteer
Experts of the Month
Expert Login

Awards

About Us
Tell friends
Link to Us
Disclaimer

 
 
 
 
About Marty Landman
Expertise
Database installation, analysis & design and programming questions.

Experience
Have done application programming as well as some installation and administration mostly with MySQL for web servers and site development and also with IMS and DB2 on legacy systems in the past.

Education/Credentials
MS in computer science.

 
   

You are here:  Experts > Industry > Data Management > Database Programming > SQL date query question

Topic: Database Programming



Expert: Marty Landman
Date: 2/15/2007
Subject: SQL date query question

Question
Hello, I have a database which has a list of products, then a list of the price of each product, and then a list of dates they were sold (D/M/YYYY).
I would I go about writing a query that would give me a list of months only and the total price of the products sold in that month. For example what is the total amount of money made in the month of February.
The variables are productName, price and transactionDate. And the table name is MAIN. I don't need to display the productName.

Answer
TJ,

select sum(price) from _________ where transactionDate like '__/02/____';

assuming the date is dd/mm/yyyy.

--
Marty Landman, Face 2 Interface Inc.
DB App: http://face2interface.com/Products/FormATable.shtml
Web Installed Formmail: http://face2interface.com/formINSTal

Add to this Answer    Ask a Question



  Rate this Answer
   Was this answer helpful?
Not at allDefinitely              
   12345  

     
About Us | Advertise on This Site | User Agreement | Privacy Policy | Help
Copyright  © 2008 About, Inc. About and About.com are registered trademarks of About, Inc. The About logo is a trademark of About, Inc. All rights reserved.