Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: If Exists? Post Reply Post New Topic
Author Message
MrCastalum
Newbie
Newbie
Avatar

Joined: 11 Mar 2010
Location: United Kingdom
Online Status: Offline
Posts: 22
Quote MrCastalum Replybullet Topic: If Exists?
     Posted: 13 Apr 2010 at 9:50pm
I am using Crystal Reports XI.

Could you tell if it is possible, and if so, how to create a crystal report that will do the following?

I need to show suppliers that we have not used for a couple of years. I know I cannot do this using the select expert to just say 'only when year is not 2010' because that will just show 2009 - 2008 data even if 2010 data exists. Is there any way I can tell it to only show data if it doesn't exist past a certain date? I believe that this is done in SQL using an 'If Exists' comman. Is there a similar function for Crystal Reports?

Thank you.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 14 Apr 2010 at 3:50am

one way to do this

pull all data
group on supplier
insert summary on the date field as Maximum date for the supplier group
go into the select expert and use the "group selection"
use your summary as your condition)
Maximum(date,supplier)<date(2009,1,1)
//or whatever your cut of date is
IP IP Logged
MrCastalum
Newbie
Newbie
Avatar

Joined: 11 Mar 2010
Location: United Kingdom
Online Status: Offline
Posts: 22
Quote MrCastalum Replybullet Posted: 15 Apr 2010 at 4:13am
This worked perfectly thanks! I made it so that the user could choose the last year as a parameter so they're jumping up and down for joy! Smile

Edited by MrCastalum - 15 Apr 2010 at 4:13am
IP IP Logged
tpreston
Newbie
Newbie


Joined: 26 Jan 2011
Online Status: Offline
Posts: 7
Quote tpreston Replybullet Posted: 26 Jan 2011 at 12:26pm
Just wanted to jump in after the fact to say thanks, DBlank. Your reply to MrCastalum solved my problem nearly a year later. Thanks!
IP IP Logged
tpreston
Newbie
Newbie


Joined: 26 Jan 2011
Online Status: Offline
Posts: 7
Quote tpreston Replybullet Posted: 19 Jun 2015 at 10:12am
Thank you very much for this. Years later it is still very helpful.

Originally posted by DBlank

one way to do this


pull all data

group on supplier

insert summary on the date field as Maximum date for the supplier group

go into the select expert and use the "group selection"

use your summary as your condition)

Maximum(date,supplier)<date(2009,1,1)

//or whatever your cut of date is



Edited by tpreston - 19 Jun 2015 at 10:13am
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