Google Answers Logo
View Question
 
Q: SQL Statement ( No Answer,   2 Comments )
Question  
Subject: SQL Statement
Category: Computers > Programming
Asked by: fdic-ga
List Price: $5.00
Posted: 19 Mar 2005 11:15 PST
Expires: 19 Mar 2005 17:51 PST
Question ID: 497249
I am trying to write a query in SQL.  The application (Access)has a
date range input box that asks what date range i am interested in. 
The format is standard MM/DD/YYYY.  The SQL data base that I am
querying is set up with two fields Expense_Yr and Expense_Month
(notice no day and dates are parsed out to seperate columns).  How
do I get my query to convert the standard date to two seperate
criteria?
Answer  
There is no answer at this time.

Comments  
Subject: Re: SQL Statement
From: crythias-ga on 19 Mar 2005 12:44 PST
 
You could set your criteria to be where Expense_Month=Month(submitted
date) and Expense_Year=Year(submitted date)...

"Month" and "Year" functions being relative to the ability of  your
SQL server to parse those functions...
Subject: Re: SQL Statement
From: nelson-ga on 19 Mar 2005 17:05 PST
 
You should consider changing how you are storing the data in Access. 
I suggest using a integer field and storing the data as yyyymm.  March
2005 would be 200503.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy