Solved

BI Report - Understand Code

Posted on 2012-03-19
6
288 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
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Introduction In the following article I’ll be discussing and demonstrating several different ways of how images can be put on a report. I’m using SQL Server Reporting Services 2008 R2 CTP, more precisely version 10.50.1352.12, but the methods ex…
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 video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

856 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