DECODE? IIF?

From: Cathy Morse <Cathy.Morse_at_ClemsonSC.ATTGIS.COM>
Date: 1995/08/04
Message-ID: <DCsHDx.L6G_at_ncrcae.ColumbiaSC.ATTGIS.COM>#1/1


I'm trying to pull data from 2 different fields, depending on the result of a comparison.

It seems that decode won't let me do a "field < x". Is there an immediate IF statement in SQLPlus, like in Access, dBase, etc, etc, etc?

Here's what I'm trying to do:

Table

	Actual Quantity	Planned Quantity	Date
	10		20		4/1/95
	10		20		5/1/95
	10		20		6/1/95
	10		20		7/1/95
			20		8/1/95
			20		9/1/95
			20		10/1/95

Desired result:
	Date	Quantity
	4/1/95	10
	5/1/95	10
	6/1/95	10
	7/1/95	10
	8/1/95	20
	9/1/95	20
	10/1/95	20

Assuming you ran this after 7/1 but before 8/1.

I need to compare the DATE field to SYSDATE and pull either PLAN or ACTUAL.

How do I do this?

Thanks         

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
All opinions expressed are my own...blah, blah, blah....

SMILE! (It makes people wonder what you're up to!)

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Received on Fri Aug 04 1995 - 00:00:00 CEST

Original text of this message