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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

unable to select records

Status
Not open for further replies.

mravimtnl

MIS
Nov 1, 2009
47
Hi
I am using the follwong record selection
formula

(({udfboolean.ub_udfgen_id} =17 or
{udfboolean.ub_udfgen_id} =18 or
{udfboolean.ub_udfgen_id} =19 or
{udfboolean.ub_udfgen_id} =20 )) and {udfboolean.ub_boolean}=1

however only records of particular persons are being selected not all the persons with mattching criteria.

Crystal file is attached.

Databas is attached
 
You need to be more specific. There is nothing wrong with your query, the OR conditions are wrapped togther in brackets. So should work as you have required.

Ian
 
When i am using the same formulas on my home pC they are functioning well and returning all the records. however, if i am testing with the server at office it is not functioning and returning very few records.
 
It might have to do with your table joins, but we need more information. What field is the person field? Maybe show your SQL query (database->show SQL query).

-LB
 
The sql is as follows:

SELECT
xaction."x_hist_type", xaction."x_term_name", xaction."x_badge_number", xaction."x_fname", xaction."x_timestamp",
udfboolean."ub_udfgen_id", udfboolean."ub_boolean",
company."company_name"
FROM
{ oj ((("Pegasys"."dbo"."xaction" xaction INNER JOIN "Pegasys"."dbo"."badge" badge ON
xaction."x_badge_number" = badge."b_number_str")
INNER JOIN "Pegasys"."dbo"."udfboolean" udfboolean ON
badge."b_cardholder_id" = udfboolean."ub_id")
INNER JOIN "Pegasys"."dbo"."cardholder" cardholder ON
badge."b_cardholder_id" = cardholder."c_id")
INNER JOIN "Pegasys"."dbo"."company" company ON
cardholder."c_company_id" = company."company_id"}
WHERE
xaction."x_timestamp" >= {ts '2011-07-01 00:00:00.00'} AND
xaction."x_timestamp" < {ts '2011-07-13 00:00:00.00'} AND
(xaction."x_hist_type" <> 33 AND
xaction."x_hist_type" <> 35 AND
xaction."x_hist_type" <> 37) AND
udfboolean."ub_boolean" = 1 AND
company."company_name" = 'SIGMA CONSTRUCTION' AND
(udfboolean."ub_udfgen_id" = 17 OR
udfboolean."ub_udfgen_id" = 18 OR
udfboolean."ub_udfgen_id" = 19 OR
udfboolean."ub_udfgen_id" = 20)
ORDER BY
company."company_name" ASC,
xaction."x_badge_number" ASC
 
It looks like you have all inner joins, so only people with records in every table who meet the criteria will appear.

-LB
 
How can we suggest a solution when we can't see the data you are getting versus the data you expect to see? Please show some sample data first as it appears, then as you expect it to appear, labelling the data with actual field names so we can see how it relates to your query.

Also, you should clarify whether in fact all people (whichever field this is) have data in every table, or whether you expect nulls.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top