Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Select statement problems
Message
 
 
To
12/11/2002 11:15:57
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Miscellaneous
Thread ID:
00721335
Message ID:
00722206
Views:
16
This message has been marked as the solution to the initial question of the thread.
Try
SELECT bd.bdkey, bd.bdname, im.iminsptype, ;
	MAX ( CASE WHEN im.iminspdt BETWEEN '01/01/2000' AND '12/31/2000' ;
	  THEN im.iminspdt ELSE Null END) ;
as YR1date , ;
...
GROUP BY bd.bdkey, bd.bdname, im.iminsptype
...
>Sergey,
>Good insight. What really happens is that there is a "mandatory" once
>a year or every two year inspections, which is classed (insptype),
>and then there other types of inspections - new construction or renovations,
>which are mechanical - heat & air, electical, plumbing, etc. - may occur
>who-knows-how-often. What I am looking for are the mandatory inspections
>which I can pick up with a WHERE clause. Yes, it's possible for them to
>occur more frequently than once a year, but it's much more likely that they
>are late rather than early.
>
>Further, there are a lot of factors in the report, and in reality,
>the report is more political than operational. And, since the
>inspections have to happen within the "next fiscal" year, an inspection
>that is due to happen once every "fiscal year could be done 729 days
>apart every other year and still be technically within the rules as they
>are established.
>
>Kinda funky, huh?
>
>Now, about that SQL syntax...
>
>
>Thanks for taking the time,
>
>sjwilson
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform