Solved

BI Report - Understand Code

Posted on 2012-03-19
6
287 Views
Last Modified: 2012-03-20
Hi Experts,
I am new to BI Report and trying to understand some existing code.  In a SQL Statement it says @Date = 'ExpDate'. I know @Date is the parameter, but what does 'ExpDate' translate to?  I looked all the tables used in the scripts.  But did not see the field ExpDate.  Any idea?  Thank you very much in Advance.
0
Comment
Question by:RadhaKrishnaKiJaya
  • 3
  • 3
6 Comments
 
LVL 37

Expert Comment

by:ValentinoV
ID: 37741014
According to what you've mentioned, 'ExpDate' is the value of the @Date parameter.  Seems a bit weird though.  Perhaps there's an IF in front of it?

I can probably give you more info if you could post the whole statement though.
0
 

Author Comment

by:RadhaKrishnaKiJaya
ID: 37742876
Hi ValentinV
Thank you very much for you reply.  Here is the code below.  Please let me know.  Thank you.

Select * from TravelTransactions
Where  (@Date = 'ExpDate' and Exists (Select 1 from TravDetails where PNRNumber = @PNRNumber and TravelDate Between @StDate and @EnDate)
0
 
LVL 37

Expert Comment

by:ValentinoV
ID: 37743142
What is the definition of that @Date parameter?  Type, and Available values?  As far as I can tell, that query will only return data when the @Date parameter is set to 'ExpDate', so I would think that the type is Text and one of the available value is 'ExpDate'.
0
Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

 

Author Comment

by:RadhaKrishnaKiJaya
ID: 37743206
@Date is a Date input field by the user.  The 'ExpDate' we are talking about, I don't see this in anywhere in the script.  So, how should I read 'ExpDate'?  Is this a memory varable or field in the Table or instant variable?  How shuld I read and reuse it if I need to?  Thank you.
0
 
LVL 37

Accepted Solution

by:
ValentinoV earned 500 total points
ID: 37743298
It's a hardcoded string in the query.  So if the parameter type is Date/Time then I don't see how that dataset can work...

Unless the single quotes shouldn't be there but that would mean there should be a column called ExpDate in the TravelTransactions table.
0
 

Author Closing Comment

by:RadhaKrishnaKiJaya
ID: 37743934
ValentinoV, That is the right answer.  I totally forgot about it.  The 'ExpDate' is hardcoded.  The @Date is a String parameter.  It looks confusing because of the naming.  Thank you very much again.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question