Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Record select with 2 vars Post Reply Post New Topic
Author Message
nbritton
Newbie
Newbie
Avatar

Joined: 30 Sep 2009
Online Status: Offline
Posts: 25
Quote nbritton Replybullet Topic: Record select with 2 vars
     Posted: 13 May 2011 at 8:24am
I need to filter out some additonal data from an allready working select statement.  The database has two tables.  One is a log table and the other is a job history table.  I need to corrolate the log entires for the failed jobs based on job id. 
 
Log table has a field for job id.
history table has a field for jobid, instance, and exit code.
 
with the following code i am able to get the data i want but i need to trim down instances of the job that have completed sucessfully.  How can i do that?
 
not ({NV_LOGS.LOG_MESSAGE} like "ERROR: Backup log * ( backup type: 'TRANSACTION/LOG NORMAL') is unavailable") and
not ({NV_LOGS.LOG_MESSAGE} like "Items other than 'Archive Logs' selected in the *") and
not ({NV_LOGS.LOG_MESSAGE} like "Transfer to the device*stalled*") and
{NV_JOB_HISTORY.Phase} = 1 and
{NV_LOGS.DATE_TIME} >= CurrentDate-1 and
{NV_JOB_HISTORY.Exit Status} = "Backup Failed" and
{NV_LOGS.JOBID} <> -1 and
{NV_LOGS.WARN_LEVEL} in ["Warning", "Severe Error", "Error"] and
{NV_JOB_HISTORY.Start Date} >= CurrentDate-1
 
Thanks for the help in advance.
IP IP Logged
c16271
Groupie
Groupie
Avatar

Joined: 24 Aug 2010
Location: United States
Online Status: Offline
Posts: 48
Quote c16271 Replybullet Posted: 13 May 2011 at 1:25pm
What's the name of the colum that tells you whether a job completed successfully?
 

Once you find it, you need to look at what the "Success" code is, once you identify that, you can set the column equal to that success code..it's hard to tell from what you posted.
 
IE, if the success code is the string "Success", and the column is in {NV_JOB_HISTORY.Exit Status}.
 
Then change the = sign to IN and add "Success". Take "Backup Failed" if you don't care to see those records.
 
 
 
not ({NV_LOGS.LOG_MESSAGE} like "ERROR: Backup log * ( backup type: 'TRANSACTION/LOG NORMAL') is unavailable") and
not ({NV_LOGS.LOG_MESSAGE} like "Items other than 'Archive Logs' selected in the *") and
not ({NV_LOGS.LOG_MESSAGE} like "Transfer to the device*stalled*") and
{NV_JOB_HISTORY.Phase} = 1 and
{NV_LOGS.DATE_TIME} >= CurrentDate-1 and
{NV_JOB_HISTORY.Exit Status} IN ("Backup Failed", "Success") and
{NV_LOGS.JOBID} <> -1 and
{NV_LOGS.WARN_LEVEL} in ["Warning", "Severe Error", "Error"] and
{NV_JOB_HISTORY.Start Date} >= CurrentDate-1
 


Edited by c16271 - 13 May 2011 at 1:26pm
IP IP Logged
nbritton
Newbie
Newbie
Avatar

Joined: 30 Sep 2009
Online Status: Offline
Posts: 25
Quote nbritton Replybullet Posted: 14 May 2011 at 3:38am
Sorry for the confussion.  Looks as if i made it very confusing.   I want to only pull back records where "backup status" = "backup Failed" But i need to further constrain this to the jobid and instance.  both feilds in the database.  The reason is there could be many attempts in the 24 hour period and i only want the failed ones.  
 
I was attempting to set a variable = to the jobid and instance when the record was found but did not have much luck with this.
 
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