Solved

BI Report - Understand Code

Posted on 2012-03-19
6
284 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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Join & Write a Comment

Suggested Solutions

Hi all, It is important and often overlooked to understand “Database properties”. Often we see questions about "log files" or "where is the database" and one of the easiest ways to get general information about your database is to use “Database p…
SQL Server engine let you use a Windows account or a SQL Server account to connect to a SQL Server instance. This can be configured immediatly during the SQL Server installation or after in the Server Authentication section in the Server properties …
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

708 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now