Returning only records that have no entry in a specific field
Hello,
I'm new to this forum and relatively new to Crystal Reports, so I apologize if this information is "plain as day" somewhere. I've been hunting for this info for quite a while and can't find anything that makes sense!
I am trying to put together a very simple report that will return only records where a certain field is blank.
It is an Access database, in an information management program specific to our type of business. CR 11 software was included with the LIMS (Laboratory Information Management System), as the reports generated from the LIMS software are in CR. I've learned enough to be able to tweak reports and make some basic reports, but I can't find a simple answer to what I think is a simple question!
I have the report set up to access the following fields in the database: Invoice number, Client name, Due date, Invoice amount, and Payment Received. This will be used as a "cross check" - not as any major accounting tool - as the Payment Received field is simply the date that the payment was received. If no payment has been received, the field is left blank.
I want the report to return ONLY those records where that field is blank (i. e. a list of invoices/clients whose payment has not yet been received).
Ideally, I would also like to be able to return only those records where that field is blank OR within a certain date range (i. e. less than 30 days from the date that the report is run). However, we'll probably only use this report a couple of times a month, so that is not as critical.
I know I need to filter the records according to the Payment Received field, but don't know how to construct a formula that says "just show the fields where there is nothing entered."
Thank you!
Brenda
This is the hardest function to find: IsNull
If isNull(field) then
// if the above fails on a numberic field or text field then see the following two-some databases are picky.
If IsNull(field) or field=0 then //this one maybe needed for a numeric field
If IsNull(field) or field="" // this one maybe needed for a text field
if IsNull(field) or field=<value>
or
if IsNull(field) or field like <value*>
You always want the IsNull statement to be the first statement, and it is especially usefull when testing for not equal
If IsNull(field) or field <> <value>
Similar Messages
-
Extract only records that have difference sum
Hi all. I'm on oracle 10g.
I have a question. I have two select statement, both with sum function.
I want that from first select I must retrieve only records which have different sum.
Here is the code:
first select statement
select a.codice_contratto codice_contratto, a.codice_qualifica codice_qualifica,
a.codice_istituzione codice_istituzione, sum(a.nume_dip_tot) tot, sum(a.nume_dip_donne) donne
from tn_bz_t_10 a
where a.anno = 2006
group by a.codice_contratto, a.codice_qualifica, a.codice_istituzione
order by a.codice_contratto, a.codice_qualifica, a.codice_istituzione
secon select statement
select codice_contratto, codice_qualifica,
codice_istituzione,
sum(nume_dip_tot17) tot, sum(nume_dip_donne17) donne
from tabella10
where anno = 2006
and versione = 'D'
and nume_dip_tot17 <> 0
group by codice_contratto, codice_qualifica, codice_istituzione
order by codice_contratto,codice_qualifica,codice_istituzione
My goal is that from first select I must retrieve only those records which have difference sum, tot or donne,
from second select...
How can I achieve that??
Thanks all for collaboration,
Fabrizio Delli Priscoli
Edited by: Fabrizio Delli Priscoli on 23-set-2010 14.25Hi, Fabrizio,
(1) an inner join, or
(2) NOT IN
are two ways that will probably be efficient.
You've been using this forum for nearly 9 years, so you know that, to get a more detailed answer, you need to post a more detailed question.
Post a little sample data (CREATE TABLE and INSERT statements) and the results you want from that data.
Format your code and results, and post them between \ tags to keep this site from removing the extra spaces.
Always say what version of Oracle you're using. -
Need help writing a MySQL query that will return only records with matching counter-parts
Since I don't know how to explain this easily, I'm using the
table below as an example.
I want to create a MySQL query that will return only records
that have matching counter-parts where 'col1' = 'ABC'.
Notice the 'ABC / GHI' record does not have a
counter-matching 'GHI / ABC' record. This record should not be
returned because there is no matching counter-part. With this
table, the 'ABC / GHI' record should be the only one returned in
the query.
How can I create a query that will do this?
id | col1 | col2
1 | ABC | DEF
2 | DEF | ABC
3 | ABC | GHI
4 | DEF | GHI
5 | GHI | DEF
*Please let me know if you have no idea what I'm trying to
explain.AngryCloud wrote:
> Since I don't know how to explain this easily, I'm using
the table below as an
> example.
>
> I want to create a MySQL query that will return only
records that have
> matching counter-parts where 'col1' = 'ABC'.
>
> Notice the 'ABC / GHI' record does not have a
counter-matching 'GHI / ABC'
> record. This record should not be returned because there
is no matching
> counter-part. With this table, the 'ABC / GHI' record
should be the only one
> returned in the query.
>
> How can I create a query that will do this?
>
>
> id | col1 | col2
> --------------------
> 1 | ABC | DEF
> 2 | DEF | ABC
> 3 | ABC | GHI
> 4 | DEF | GHI
> 5 | GHI | DEF
>
>
> *Please let me know if you have no idea what I'm trying
to explain.
>
Please be more clear. You say that 'ABC / GHI' should not be
returned,
and then you say that 'ABC / GHI' should be the only one
returned. Can't
have both... -
Include those records that have Null End Dates
I have to pull a report that show those who are currently working so we are assuming those with no End Dates are still working. When I put '0' or '0/0/00' for the End Date I get an error stating I need to put in a date.
How do I only include those records that have Null End Dates? Ultimately I need a count of those currently employed. So I'm assuming once my report only shows those records I can add a running total field.
I have Crystal XI.
ThanksTry entering some default value for null like enter a default date "1/1/1900" which means that the end date is null.
Now in the record selection write the condition like this
if {?EndDateParameter}=date(1900,1,1) then
(isnull(datefield)=true or totext(datefield)="")
else
datefield={?EndDateParameter}
Regards,
Raghavendra -
Find all records that have character alone in a string
Oracle 10g Enterprise Edition
Hi all,
I must select from a varchar2 field, all the records that have a character (number or char) alone in the string.
For example.
ASDF BHGR H RR (yes, cause "H")
ASDF BHGR H4 R (yes, cause "R")
ASDF B H4 DDR (yes, cause "B")
ASDF B H4 DDR (yes, cause "B")
ASDF BC 1 DDR (yes, cause "1")
ASDF BC / DDR (yes, cause "/")
ASDF BHGR H4 RR (no)
ASDF (no)
I'm trying by SubStr, but I cannot generally solutions.
Thank's for any suggestion.
CiaoOk, just a try :
SQL> with tbl as
2 (select 'ASDF BHGR H RR' str from dual union all
3 select 'ASDF BHGR H4 R' str from dual union all
4 select 'ASDF B H4 DDR' str from dual union all
5 select 'ASDF BHGR H4 R1' str from dual union all
6 select 'ASDF BHGR H4' str from dual union all
7 select 'ASDF - H4' str from dual union all
8 select 'a1 ASDF BHGR H4' str from dual union all
9 select 'ASDF B H4 DDR' str from dual union all
10 select 'ASDF BC 1 DDR' str from dual union all
11 select 'ASDF BC / DDR' str from dual)
12 select str,
13 decode(regexp_instr(str,'^. | . | .$'),0,'no',decode(regexp_instr(str,'^- | - | -$'),0,'yes','no')) res
14 from tbl;
STR RES
ASDF BHGR H RR yes
ASDF BHGR H4 R yes
ASDF B H4 DDR yes
ASDF BHGR H4 R1 no
ASDF BHGR H4 no
ASDF - H4 no
a1 ASDF BHGR H4 no
ASDF B H4 DDR yes
ASDF BC 1 DDR yes
ASDF BC / DDR yes
10 rows selected.May is there is a simpler way.
Nicolas. -
Is there any way to return back vedio that have been deleted before back up and can I cloud back up be enough , it's been deleted after less than 10 minutes by mistake
Answered here:
https://discussions.apple.com/thread/6066113?tstart=0
Did you really think you were gonna get a different answer? -
Using EVDRE to return only records having a value greater than X
in the old reporting wizard you could use MDX statement like "return only those members/data where the value of some account is greater than 100".
Thus allowing you to select for instance those entities that had signinficant sales or the like.
In EVDRE i am looking for a way to do the same but apart from returning the Top n members or suppressing zero's i cannot fnd a way to do this. From an earlier post in the old outlooksoft consultancy forum (dating from march last year) i understood that this functionality was already prepared so i assumed it is in, but how ???? (if it is there of course).
I hope some of you have the answer.....
Thanks,
Edwin van Geel (SAP Netherlands)Maggie, I think what David's answer implies is this:
You can't (now, 5.1) use EVDRE to do a suppression based on signeddata.
You can either build your entire report with EVENEs for the expansion, and EVGETs for the data retrieval (basically use the wizard templates) or use an EVENE for the expansion and EVDRE to only retrieve the data. The second option's a bit more complicated to set up, but likely the better approach in terms of performance and future-proofing.
Either way, in the EVENE you use the MDX filter, both to evaluate the data values, and the other filter requirement you have. -
Display total of contents of 'fields a' for records that have identical 'fields b' in common
Please forgive me for my inability to put this in simple
terms. I tried to search the forums for a solution but when you
can't formulate your question in a pithy manner it's nigh
impossible!
I am attaching code for a query that grabs all the records in
a few tables that relate to workshops that have been attended but
not yet paid for. What I want to do with them next is to add the
"WorkshopCost" field for each of the records that has an identical
"SchoolName" and display the result, so that we have a subtotal for
each school.
I suspect this should probably be very easy but for some
reason I can't figure out how it should be accomplished - if there
is another posting where this is answered I would be very happy is
someone would point it out! or otherwise give me a shove in the
right direction.
I'm thinking I need to do something with the array created by
my query...?If I am understanding correctly, you would like to display a
subtotal for each school. A simple option is to use the "group"
attribute of cfquery. Then you could calculate the subtotal as you
loop through the results and display it after each section. Another
option is to use a QoQ.
Keep in mind that when using "group", your sql query
must order the results the same way. In other words, if you
are grouping by "s_SchoolName" then your query must also ORDER BY
s_SchoolName. Otherwise, the results will display incorrectly. -
Are Apple products the only ones that have the option to have a hot spot built into i?
my husband needs to use a tablet for work. We don't have an Internet provider for it. I thought about using a personal hot spot for it. I have 2 Apple products he doesn't have any. Can you use a personal hotspot for them. I am not familiar with his products at all. Is Apple the only one that offers a hotspot on their products?
No. Click here and see the third paragraph.
(120029) -
Collect only columns that have values
I have one Collection called Collection1 with the following columns:
First
Last
Company
I'd like to collect that information into another collection, but only the columns that have data in them. I can do it using multiple If statements for each column If(IsEmpty()), but this can create a LOT of If statements if I'm using a lot of
columns, rather than just the 3 in the example.
Is there a way to evaluate each column, and only collect it if it isn't empty without having to type out each column name in an If statement?
-BrutonHello Oliver,
Thanks for your help. In that example, I would like:
First Last Company
John Contoso
Smith Contoso2
Brad Anderson
What I'm looking for how to do is if I have:
First Last Company
John Smith <empty>
Bruton Gaster <empty>
Barry Manalo <empty>
I want to collect First and Last, but if I have:
First Last Company
Scott <empty> Acumen
Bill <empty> Microsoft
Fred <empty> Dell
I want to collect First and Company. The Column names may be based off variables, so I'd rather not have to throw a bunch of If statements at it, but if I have to, I have to.
Thanks!
-Bruton -
NEED TO DETERMINE USERS THAT HAVE LOGGED IN WITH A SPECIFIC ROLE
I have a requirement to determine which users have logged in with a specific
role or accessing a specific application. I know I can use the
ORASSO.WWSSO_AUDIT_LOG_TABLE_T table to see the users that have logged in, but
need to know which table to join with in order to determine which group that a
user belongs to. It would also be nice to figure out which users are accessing
a given application.
We are running AS 9.0.4.2 with ORASSO database 9.0.1.5.
Can you identify which tables I will need to use to satisfy my requirement?
Thanks, MikeThanks! I modified this slightly to get what I needed but I didn't think that I could get this from dba_tab_privs. You were a huge help!
select table_name, grantee
from dba_tab_privs
where
table_name in ('UTL_FILE', 'UTL_TCP', 'UTL_HTTP', 'UTL_SMTP', 'DBMS_LOB', 'DBMS_SYS_SQL', 'DBMS_JOB', 'DBMS_BACKUP_RESTORE')
and privilege='EXECUTE'
order by table_name; -
Once more - tabular form / update only rows that have changed
I know it's been asked before, but I haven't seen an answer I like. :-)
I have a query that includes a single column the user can update, using APEX_ITEM.TEXT(10, updateable_field, 10, 10)
I have an additional APEX_ITEM.HIDDEN(21) and APEX_ITEM.HIDDEN(22) that hold the two fields of the composite primary key. In order to track whether my updateable_field had changed, I created APEX_ITEM.HIDDEN(11, updateable_field), which I expected would hold the OLD value of the field. See where I'm going with this? :-)
I'm attempting to loop through apex_application.g_f21, get the values for F10 (new) and F11 (old) and compare them. If they're different, I'll do the update.
It works fine if the old value (F11) is empty and I plug in a new value (to F10).
But if I change a field that had already has a value (in F11) and make it NULL, I notice that F11(i) doesn't exist. In that case, I set the value to NULL, and the compare fails because it thinks the row is unchanged.
Can someone suggest or point me to an alternate method that works?
Thanks as always,
StewMike,
Thanks for the suggestion, which is a good one. But I had that one covered.
I have it working now, and I believe the fix was that I moved the APEX_ITEM.HIDDEN that contained the old value in the query. I'd had it concatenated with the column for the new value (which used APEX_ITEM.ITEM). I changed it to concatenate to a plain string value. And now the array has values in it, which I can properly compare.
Thanks again. That was really driving me nuts!
Stew -
How to use RichCopy to copy only files that have changed?
I am using RichCopy to copy files and folders from one system to another on a weekly basis. RichCopy is working fine, but it is copying 100% of the data every time. I am looking for a way to use RichCopy where it will compare files/folders from
the source and only copy what data has changed to the destination. I cannot find the option to do that.
Any help would be greatly appreciated...
Thank you.RichCopy is not a Windows 7 feature and it is an obsolete utility and there is no support for RichCopy.
Info found @ http://en.wikipedia.org/wiki/RichCopy
RichCopy is not supported by Microsoft.<sup class="reference" id="cite_ref-technet200904_1-1">[1]</sup> The program has
not been updated since approximately June 2009, despite numerous users requesting for bug fixes.<sup class="reference" id="cite_ref-4">[4]</sup>
Duplicates functionality already in
Robocopy
Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. ” -
Stuck on sql query to find parent records that have the same child records
Oracle 10gR2 Enterprise Edition.
Hi,
I'm trying to write some logic to look for records in a parent table, which have the exact same values in a child table.
This is part of a bigger query, but I'm stuck on this part for now, so I've mocked up some simplified tables below to capture the core of the
problem I'm stuck on.
Let say I've got a parent table Manager, a child table Employee and there's a many to many relationship between them.
The aptly named Join_Table handles the relationship between them. So one manager can manage many employees, one employee can be managed by
many managers.
I've a feeling this is stupidly easy, but I seem to be suffering from a bad bout of brain freeze today!
-- parent table
CREATE TABLE manager (
id number primary key,
name varchar2(100));
-- child table
CREATE TABLE employee (
id number primary key,
name varchar2(100));
-- link table
CREATE TABLE join_table (
manager_id NUMBER,
employee_id NUMBER,
CONSTRAINT join_table_pk PRIMARY KEY (manager_id, employee_id),
CONSTRAINT manager_fk FOREIGN KEY (manager_id) REFERENCES manager(id),
CONSTRAINT employee_fk FOREIGN KEY (employee_id) REFERENCES employee(id)
-- Insert some managers
INSERT INTO manager (id, name) VALUES (1, 'John');
INSERT INTO manager (id, name) VALUES (2, 'Bob');
INSERT INTO manager (id, name) VALUES (3, 'Mary');
INSERT INTO manager (id, name) VALUES (4, 'Sue');
INSERT INTO manager (id, name) VALUES (5, 'Alan');
INSERT INTO manager (id, name) VALUES (6, 'Mike');
-- Insert some employees
INSERT INTO employee (id, name) VALUES (101, 'Paul');
INSERT INTO employee (id, name) VALUES (102, 'Simon');
INSERT INTO employee (id, name) VALUES (103, 'Ken');
INSERT INTO employee (id, name) VALUES (104, 'Kevin');
INSERT INTO employee (id, name) VALUES (105, 'Jack');
INSERT INTO employee (id, name) VALUES (106, 'Jennifer');
INSERT INTO employee (id, name) VALUES (107, 'Tim');
-- Insert the links
-- John manages Paul, Simon, Ken
INSERT INTO join_table (manager_id, employee_id) VALUES (1, 101);
INSERT INTO join_table (manager_id, employee_id) VALUES (1, 102);
INSERT INTO join_table (manager_id, employee_id) VALUES (1, 103);
-- Bob manages Paul, Simon, Kevin, Jack
INSERT INTO join_table (manager_id, employee_id) VALUES (2, 101);
INSERT INTO join_table (manager_id, employee_id) VALUES (2, 102);
INSERT INTO join_table (manager_id, employee_id) VALUES (2, 104);
INSERT INTO join_table (manager_id, employee_id) VALUES (2, 105);
-- Mary manages Jennifer, Tim
INSERT INTO join_table (manager_id, employee_id) VALUES (3, 106);
INSERT INTO join_table (manager_id, employee_id) VALUES (3, 107);
-- Sue manages Jennifer, Tim
INSERT INTO join_table (manager_id, employee_id) VALUES (4, 106);
INSERT INTO join_table (manager_id, employee_id) VALUES (4, 107);
-- Alan manages Paul, Simon, Ken, Jennifer, Tim
INSERT INTO join_table (manager_id, employee_id) VALUES (5, 101);
INSERT INTO join_table (manager_id, employee_id) VALUES (5, 102);
INSERT INTO join_table (manager_id, employee_id) VALUES (5, 103);
INSERT INTO join_table (manager_id, employee_id) VALUES (5, 106);
INSERT INTO join_table (manager_id, employee_id) VALUES (5, 107);
-- Mike manages Paul, Simon, Ken
INSERT INTO join_table (manager_id, employee_id) VALUES (6, 101);
INSERT INTO join_table (manager_id, employee_id) VALUES (6, 102);
INSERT INTO join_table (manager_id, employee_id) VALUES (6, 103);
-- For sanity
CREATE UNIQUE INDEX employee_name_uidx ON employee(name);So if I'm querying for manager John, I want to find the other managers who manage the exact same list of employees.
Answer should be Mike.
If I'm querying for manager Mary, answer should be Sue.
This query will give me the list of managers who manage some of the same employees as John, but not the exact same employees...
SELECT DISTINCT m.name AS manager
FROM manager m, join_table jt, employee e
WHERE m.id = jt.manager_id
AND jt.employee_id = e.id
AND e.id IN (
SELECT e.id
FROM manager m, join_table jt, employee e
WHERE m.id = jt.manager_id
AND jt.employee_id = e.id
AND m.name = 'John')
ORDER BY 1;I thought about using set operations to find managers whose list of employees minus my employees is null and where my employees minus their list of employees is null. But surely there's a simpler more elegant way.
Any ideas?
Btw, I need to run this as a batch job against tables with >20 million rows so query efficiency is key.What about...
WITH manager_list AS
SELECT name,
LTRIM(MAX(SYS_CONNECT_BY_PATH(id,','))
KEEP (DENSE_RANK LAST ORDER BY curr),',') AS employees
FROM (SELECT m.name,
e.id,
ROW_NUMBER() OVER (PARTITION BY m.name ORDER BY e.id) AS curr,
ROW_NUMBER() OVER (PARTITION BY m.name ORDER BY e.id) -1 AS prev
FROM manager m,
join_table jt,
employee e
WHERE m.id = jt.manager_id
AND jt.employee_id = e.id
AND m.name = :P_MANAGER)
GROUP BY name
CONNECT BY prev = PRIOR curr AND name = PRIOR name
START WITH curr = 1
), all_list AS
SELECT name,
LTRIM(MAX(SYS_CONNECT_BY_PATH(id,','))
KEEP (DENSE_RANK LAST ORDER BY curr),',') AS employees
FROM (SELECT m.name,
e.id,
ROW_NUMBER() OVER (PARTITION BY m.name ORDER BY e.id) AS curr,
ROW_NUMBER() OVER (PARTITION BY m.name ORDER BY e.id) -1 AS prev
FROM manager m,
join_table jt,
employee e
WHERE m.id = jt.manager_id
AND jt.employee_id = e.id)
GROUP BY name
CONNECT BY prev = PRIOR curr AND name = PRIOR name
START WITH curr = 1
SELECT a.*
FROM manager_list m,
all_list a
WHERE m.employees = a.employeesWould be easier in 11g, but I don't have an installation here so this is based on 10g.
Cheers
Ben -
Inserting records that have a timestamp
I have a table with field1 as "timestamp with timezone". The bulk records I am trying to load have timestamp format = "YYYY-MM-DD HH24:MI:SS.FF". I altered the session nls_timestamp_format to "YYYY-MM-DD HH24:MI:SS.FF", but get 'bad month' when loading the tables. If I add the (to_timestamp(2005-02-25 14:12:22.003222)), I can load the record without an error. I don't want to add the 'to_timestamp to thousand of records. How can I alter the nls_timestamp_format and it allow me to insert all the records.
Thanks in advancewhat according to you represents the current record?
Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs
Maybe you are looking for
-
Earlier tonight, I saw the balloon from Creative Cloud stating that an update was available. So I installed it. Half-way during the installation, my windows desktop disappeared. I started the task manager and restarted "Explorer.exe". That made th
-
Does Nokia Asha 501 comes with USB cable?
Does Nokia Asha 501 comes with USB cable? Solved! Go to Solution.
-
As Wendy Li informed that PPT ask you to update from slide library automatically. But this happens only if the slides are saved in your system(in read write mode). Is it possible to run the updates automatically on Read-only slides as well. Thanks. O
-
How to make mandatory field in custom form
Hi, we have oracle ebs R12.1.3 and oracle DB 11.2.0.3. In a new developed custom form, we want to make a field mandatory. It should be displayed as yellow at the time of running the form. Can anyone guide me. regards Sanjay
-
Crackle and Pops in 64 bit mode ?
Everytime the music passes a change of tempo there are pops and crackles in the sound. If it is because of using 32 bit pluins in 64 bit mode , How can I eleminate pops and crackles? Changing to a larger Buffer size doesn't work. What will?