Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Select query Post Reply Post New Topic
Author Message
gemcka
Newbie
Newbie


Joined: 02 Aug 2011
Online Status: Offline
Posts: 16
Quote gemcka Replybullet Topic: Select query
     Posted: 02 Aug 2011 at 12:20am
Hi all,
 
I am new to report writing and have what I'm sure is a simple question!
 
I have a table of results showing stock level, forecast level and part number.
 
All I need to do, is not show the parts that have 0 stock AND 0 forecast.
 
I need to see them if they have stock but 0 forecast also if they have forecast but 0 stock.
Thanks for any help
IP IP Logged
FrnhtGLI
Senior Member
Senior Member
Avatar

Joined: 22 May 2009
Online Status: Offline
Posts: 347
Quote FrnhtGLI Replybullet Posted: 02 Aug 2011 at 1:58am
Go to Report > Selection Formulas > Record and enter something like:

({table.stock}<>0
and
{table.forecastlevel}<>0)

|< /\ '][' ( )
IP IP Logged
gemcka
Newbie
Newbie


Joined: 02 Aug 2011
Online Status: Offline
Posts: 16
Quote gemcka Replybullet Posted: 02 Aug 2011 at 2:22am
Thanks but this look like it does not pull any results back for 0 in either column nad not just 0 in both.
here is the selection formula i am using
 
{CUSTOMER_ORDER_JOIN\.LINE_STATE} <> "Cancelled" and
{FORECAST_DAY_PUB\.START_DATE} = ( if DayOfWeek (currentdate) in 2 to 7
    then  currentdate - DayOfWeek (currentdate)+2
    else  currentdate + 1) and
{FORECAST_DAY_PUB\.PART_NO} startswith "4" and ({VENDOR_MANAGEMENT.ON_HAND_STOCK}<>0 and {@forecast week2}<>0)
 
in the last line:
({VENDOR_MANAGEMENT.ON_HAND_STOCK}<>0 and {@forecast week2}<>0)
 
it doesn't make any difference if I have the brackets around it or not it still treats them as individual statements.
 
 
IP IP Logged
sharona
Senior Member
Senior Member
Avatar

Joined: 16 Oct 2008
Location: United States
Online Status: Offline
Posts: 255
Quote sharona Replybullet Posted: 02 Aug 2011 at 3:03am
i think you need an OR
({VENDOR_MANAGEMENT.ON_HAND_STOCK}<>0 OR {@forecast week2}<>0)
sharona
IP IP Logged
gemcka
Newbie
Newbie


Joined: 02 Aug 2011
Online Status: Offline
Posts: 16
Quote gemcka Replybullet Posted: 02 Aug 2011 at 4:01am
Perfect!
Case closed!!
Thanks for your time Wink
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum