?
Solved

BI Report - Understand Code

Posted on 2012-03-19
6
Medium Priority
?
292 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 

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 2000 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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

A recent question popped up and the discussion heated up regarding updating a COMMENTS (TXT) field in a table using SSRS. http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/MS-SQL_Reporting/Q_27475269.html?cid=1572#a37227028 (htt…
Introduction Earlier I wrote an article about the new lookup functions (http://www.experts-exchange.com/A_3433.html) that ship with SQL Server 2008 R2.  In this article I’m going to show you another new feature of SSRS 2008 R2, this time in the vis…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

765 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