Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Viewing date formulas in a view

Status
Not open for further replies.

Snakeroot

Technical User
Oct 4, 2006
112
US
I have a few views that I'd like to see the original code, but when I edit the view it's showing the calculated date rather than the formula used to come up with that date. Is there anyway to keep SQL from processing the calculation so that I can just see the code?

BTW, I'm using SQL 2008.
 
In a query window:

sp_helptext 'your view name'


-George

"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
 
That didn't work for me. It still shows the calculated date.
 
What does it look like? Maybe it is a hard-coded date.

-George

"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
 
Code:
This is in the select part:  
DATEDIFF(Day,CAST(dbo.AF_QB_Invoice.TxnDate AS datetime), '12/24/09') AS DaysSinceLastRental


This is in the where part:
WHERE     (dbo.AF_QB_Invoice.TxnDate >= 'Jun 24 2009') AND (dbo.AF_QB_Invoice.TxnDate <= '12/24/09') AND (dbo.AF_QB_Invoice.TemplateRef_FullName = 'Cylinder Rental')

I know that in the where part, there's supposed to be 180 days difference. I'm just not sure what the '12/24/09' is. It's obviously not Now(). Possibly "last Thursday", but the logic doesn't click for me. I can find out what it's supposed to be once I get back to the office next week. I was just hoping there was some quick way to get it out of the stored procedure.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top