Help filtering records

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



I have a report I am running and I want to select a distict date. I am
including the SQL statement and record select Formula info. Evertime I try
to use the Maximum function it tells me it is missing a boolean value. I
inherited this report and do not do much crystal reports. I am trying to
get the last record for @Edate for each person. Thanks.

John




SQL
SELECT
EVENTS."SERIALNUM", EVENTS."EVENTIME", EVENTS."EVENTTYPE",
EVENTS."EVENTID", EVENTS."MACHINE",
READER."TIMEATT",
EMP."ID", EMP."LASTNAME", EMP."FIRSTNAME", EMP."MIDNAME",
BADGE."FIRE", BADGE."MED", BADGE."HAZMAT", BADGE."HARESCUE"
FROM
{ oj (("EVENTS" EVENTS INNER JOIN "EMP" EMP ON
EVENTS."EMPID" = EMP."ID")
INNER JOIN "ACCESSCONTROL"."LENEL"."BADGE" BADGE ON
EVENTS."EMPID" = BADGE."EMPID")
INNER JOIN "READER" READER ON
EVENTS."MACHINE" = READER."PANELID" AND
EVENTS."DEVID" = READER."READERID"}
WHERE
EVENTS."EVENTTYPE" = 0 AND
(EVENTS."EVENTID" <> 2 AND
EVENTS."EVENTID" <> 3) AND
READER."TIMEATT" = 1 AND
(BADGE."FIRE" = 1 OR
BADGE."HAZMAT" = 1 OR
BADGE."MED" = 1 OR
BADGE."HARESCUE" = 1)
ORDER BY
BADGE."FIRE" ASC,
BADGE."HAZMAT" ASC,
BADGE."MED" ASC,
BADGE."HARESCUE" ASC

Forumla Editor
({EVENTS.EVENTTYPE} = 0 and ({EVENTS.EVENTID} <> 2 and {EVENTS.EVENTID} <>
3))
and {READER.TIMEATT} > 0 and {@EDATE} = CurrentDate and {READER.TIMEATT} =
1
and ({BADGE.FIRE} = 1 or {BADGE.HAZMAT} = 1 or {BADGE.MED} = 1 or
{BADGE.HARESCUE} = 1)


.



Relevant Pages

  • Re: Storing Queries in Tables
    ... Either you should follow the method Oracle is using to store SQL ... It looks like one of those databases has a multibyte characterset ... User runs a report by running a generic ksh with parameters e.g. name ... the net effect would be to reduce the report SQL statement size by the ...
    (comp.databases.oracle.misc)
  • Re: Reports, Subreports & VBA
    ... Then create a new query, ... Allen Browne - Microsoft MVP. ... >> it should give the right results when the main report calls it. ... >>> In the example of your SQL Statement, ...
    (microsoft.public.access.reports)
  • Re: Reports, Subreports & VBA
    ... In the example of your SQL Statement, ... having the code run the main report or the subreport? ... this only works correctly if you always open the report through ... different fields appear on the user form. ...
    (microsoft.public.access.reports)
  • RE: SQL Qs + Self Contained Report Format Q
    ... I'm experiencing a few problems with the SQL statement below: ... In the report form's Data Environment.Before Open Tables event, I call my criteria form which returns a WHERE clause to be used by an SQL statement. ... Leave report cursor opened. ...
    (microsoft.public.fox.programmer.exchange)
  • Re: Oracle query assistence
    ... ORDER BY PRODUCT_NAME ASC, REPORT_DATE ASC ... IT Manager/Oracle DBA ... ROW_NUMBEROVER (PARTITION BY T.PRODUCT_NAME ORDER BY ... Kind of make you wonder if this confusing SQL statement will also ...
    (comp.databases.oracle.server)