Results 1 to 4 of 4
  1. #1
    Join Date
    May 2004
    Posts
    86

    Unanswered: Highlighting a record

    I have a query that runs and shows two number feilds. Now if the number feilds dont match i want the query to only display these feilds. if the number matches then it will show nothing.


    So basically it only returns the numbers dont match out of feild 1 and feild 2

    so if

    feild one had 50 and feild 2 had 60 then it would display in the query otherwise would be blank.?

    An example would be great thanks

  2. #2
    Join Date
    Jul 2003
    Location
    Michigan
    Posts
    1,941
    SELECT FIELD1, FIELD2 FROM YOURTABLE WHERE FIELD1<>FIELD2

    Is that what you're looking for?
    Inspiration Through Fermentation

  3. #3
    Join Date
    May 2004
    Posts
    86

    Heres The Issue

    im trying to only show vaules that arent equal. In my feild Form AMOUNT and Paid Amount. So if their is 50 in the Form AMOUNT and Paid AMount is 60 it will show if THEY both say 60 then it will show blank.





    SELECT CFR.CFR_PATNAME, CFR.CFR_DCN, CFR.CFR_LINSEQ, (Val([CFR_ALLOWED])-Val([CFR_DEDUCT])-Val([CFR_OTHER])-Val([CFR_Coins])-Val([CFR_COBAMT]))/100 AS [Form Total], Format([Form Total],"$.00") AS [Form AMOUNT], Format([CFR_PAID])/100 AS PAID, Format([PAID],"$.00") AS [PAID AMOUNT]
    FROM CFR
    WHERE Not ("Form AMOUNT") = ("PAID AMOUNT") ;

  4. #4
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    your query will only return rows which are equal, so you will never get rows which are not equal based on that query.

    To do this in a query you need to do a conditional include using iif
    eg
    AmountVariance:iif(([amount]-[amountpaid])<>0,[amount]-[amountpaid],null)

    howeevr I suspect it would make more sense to place this logic in the report
    in the section format event
    if ([Amount]<>[AmountPaid]) then
    [Amount].visible=false
    [AmountPaid].Visible=false
    else
    [Amount].visible=true
    [AmountPaid].Visible=true
    endif

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •