Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Selection formula

Status
Not open for further replies.

grierfield

Technical User
Dec 18, 2002
55
US
With this formula I am trying to select all the {bl_exp.PURPOSE} fields that have a “Q” or “P” for the year 2003. however for some reason the selection is not being limited to year 2003, i am getting the P and Q for 1995, 1996 … thru 2003. what is wrong with the formula below that I am using?

{bl_exp.D_EXP} > Date (1995, 12, 31) and
{bl_exp.PURPOSE} = "P" or {bl_exp.PURPOSE} = "Q"
 
Try this:

({bl_exp.D_EXP} > Date (2002, 12, 31)) and
({bl_exp.PURPOSE} = "P" or {bl_exp.PURPOSE} = "Q")

Hope that helps!
Brett (smsforce)


--------------------------
Please visit my website!
 
The formula says greater than 1995, why are you expecting > 2002?

Select Report->Edit Selection Formula->Record and place something like:

{bl_exp.D_EXP} > Date (2002, 12, 31) and
{bl_exp.PURPOSE} = "P" or {bl_exp.PURPOSE} = "Q"

-k
 
You need parentheses after the 'and' to group your two 'or' conditions. Try this instead:

Code:
bl_exp.D_EXP} >= Date (2003, 1, 1) and
({bl_exp.PURPOSE} = "P" or {bl_exp.PURPOSE} = "Q")
 
If I'm not mistaken, you will still have to use the parenthesis or the formula will look for:
date > 12/31/02 and purpose='P'
-or-
purpose='Q' (no date specified)

I could be wrong, but better safe than sorry!
Brett (smsforce)

--------------------------
Please visit my website!
 
-k, the formula actually says >Date(2002,12,31) and not > Date(1995, 12, 31) as I posted, the actual formula is as shown below, THANX

{bl_exp.D_EXP} > Date (2002, 12, 31) and
{bl_exp.PURPOSE} = "P" or {bl_exp.PURPOSE} = "Q"
 
Use the formula exactly as it's shown in my first reply and that should fix it. :)
Brett (smsforce)

--------------------------
Please visit my website!
 
Thanks Brett, the parenthesis made the difference,
Grier.

({bl_exp.D_EXP} > Date (2002, 12, 31)) and
({bl_exp.PURPOSE} = "P" or {bl_exp.PURPOSE} = "Q")

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top