Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase ««12

Stairway to T-SQL Part 2: Beyond T-SQL Basics: Level 2: Writing Subqueries Expand / Collapse
Author
Message
Posted Thursday, March 6, 2014 7:54 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Friday, July 18, 2014 2:06 PM
Points: 1, Visits: 4
The example for Listing 6 is wrong. It has the same query as listing 5. Please correct it.
Post #1548297
Posted Tuesday, December 23, 2014 8:27 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Yesterday @ 2:48 PM
Points: 4, Visits: 21
lara.krefski (3/6/2014)
The example for Listing 6 is wrong. It has the same query as listing 5. Please correct it.


I think the author meant something like:

Select
OrderDate,
DateDiff(day,OrderDate,(Select MAX(OrderDate) from Sales.SalesOrderHeader)) 'Days to Max OrderDate',
(Select MAX(OrderDate) from Sales.SalesOrderHeader) 'Max Order Date'
from Sales.SalesOrderHeader

Post #1646194
Posted Wednesday, January 7, 2015 9:48 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, January 7, 2015 9:49 AM
Points: 2, Visits: 16
you might be using new version of adventure works database. change the year in order date and you will get results.
Post #1649176
« Prev Topic | Next Topic »

Add to briefcase ««12

Permissions Expand / Collapse