Advertisement

06.06.2008 at 10:05AM PDT, ID: 23464371
[x]
Attachment Details

Adding or subtracting to date field in WHERE clause

Asked by saturation in SQL Query Syntax

Tags: Microsoft, SQL

I am trying to set up a few different queries based on a date field and have no idea how to do it.  For example, I need to get a date 4 months before the date field.  I also need to do 2 weeks before.  So,

SELECT * FROM Oppo WHERE [TODAY'S DATE IF 4 MONTHS BEFORE oppo_finishdate ] or
SELECT * FROM Oppo WHERE [TODAY'S DATE IF 2 WEEKS BEFORE oppo_finishdate ]

How do I setup these queries?
Start Free Trial
[+][-]06.06.2008 at 10:35AM PDT, ID: 21731118

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.07.2008 at 10:45AM PDT, ID: 21736275

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: SQL Query Syntax
Tags: Microsoft, SQL
Sign Up Now!
Solution Provided By: mark_wills
Participating Experts: 2
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628